Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some css decorations #38

Closed

Conversation

andrejsharapov
Copy link
Contributor

What is the purpose of this pull request?

  • New feature
  • Bugfix
  • Breaking change
  • Styles
  • Documentation update
  • Other

Description

I've added some dynamism to the main page and made some improvements to the code.

Checklist

  • replace svg-background in Hero component to css pattern;
  • align to edge and add some dynamic for LibraryCard's;
  • change waves in ``HomeSection`;
  • other minor changes.

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #yyy).

@mririgoyen
Copy link
Member

I'll take a look at this tonight and provide my feedback.

But may I please ask that you do not implement a git commit message style that we do not intend to follow. It'll make the history look out-of-place if some message follow some sort of style and others do not. As I stated before, we're not planning to adhere to any kind of message style for this project as the overhead does not provide us with any benefits.

P.S. I hope you don't think contributing to us is a "chore"! 🤣

Copy link
Member

@mririgoyen mririgoyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, I think the style changes are good.

  • I like the new grid, the removal of the SVG assets, and the extra wave.
  • I like dropping the containing box around the library cards.

What I would like to see changed:

  • Remove the animation on the hover of "Scroll to Learn More."
  • Remove the all hover states on the library cards. I think they fit the style of the entire website uncontained.

Bugs:

  • Please check the site in responsive sizes. There is currently a horizontal scroll. It looks likely due to the width of the buttons in the library cards.
    Screenshot 2023-01-30 at 8 15 50 PM

Another Notes:

  • As mentioned in the code comments, it doesn't look like the changes went through our stylelinter. Please run npm run lint to find errors in our rules. I'll be working on adding that to the pipeline next so we can enforce consistent code.

padding: 1.5rem;
background-color: hsl(var(--secondary-color));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you may not have had the stylelint plugin working when making these changes. A lot of rules are arbitrarily reordered when they should be alphabetical. Please make sure everything is passing npm run lint before committing. I'll get a pipeline job in place to address this shortly.


.wordmark {
display: none;
}

.monogram {
width: 35px;
width: 2.1875rem;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you converted many px values to rem? There's very specific places where px are preferred, namely around graphic sizing which, in this example, is the case. I'd prefer to see px to remain in px unless it directly affects font-size.


& :not(:last-child) {
border-bottom: 1px solid hsl(var(--light-grey));
border-bottom: thin solid hsl(var(--light-grey));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, please use exact values.

@media only screen and (max-width: $mobile-width) {
section:not(.full) {
background-position: 0 2rem;
@media ($mobile-width >= width) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave the media queries as they were written.


'&:hover': {
letterSpacing: 1.1,
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this change.

font: {
size: 2.5rem;
weight: 600;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I appreciate the ability to nest rules in this way, it makes using automatic alphabetizing more difficult and I would prefer we do not do this.

z-index: 1;
width: 100%;
height: 6.25rem;
background-color: hsl(var(--primary-color) / 100%);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 100% isn't necessary here.

}
}

@media only screen and (max-width: $mobile-width) {
@media (46rem >=width) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No magic numbers please. Where is 46rem coming from?

@@ -32,13 +43,14 @@
.image {
position: relative;
width: 100%;
transition: all 0.25s linear;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this transition.

@andrejsharapov
Copy link
Contributor Author

Good. Today I will make all the corrections.

A few more wishes:

  • It would be nice to make a template for PR.
  • Add a CONTRIBUTING file or create a Wiki so other members can follow the instructions and not make the same mistakes I did.

@andrejsharapov andrejsharapov changed the title chore(style): add some css decorations Add some css decorations Jan 31, 2023
@mririgoyen
Copy link
Member

  • It would be nice to make a template for PR.

I agree, I will be creating these soon. Same for issues.

  • Add a CONTRIBUTING file or create a Wiki so other members can follow the instructions and not make the same mistakes I did.

Our contributing information is linked in the README: https://pictogrammers.com/docs/contribute/website/.

@andrejsharapov
Copy link
Contributor Author

Our contributing information is linked in the README: pictogrammers.com/docs/contribute/website.

I meant something like Code style mentioning stylelint.

@mririgoyen
Copy link
Member

Our contributing information is linked in the README: pictogrammers.com/docs/contribute/website.

I meant something like Code style mentioning stylelint.

Yep, the documentation needs to be expanded on. There's already an issue open for it. 😄

Copy link
Member

@mririgoyen mririgoyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's still some code changes that need to happen here. Once they're done, I will pull down the branch to do some manual testing before giving it the 👍🏼. There are also merge conflicts that need to be resolved.

components/Header/Header.module.scss Outdated Show resolved Hide resolved
components/Hero/Hero.module.scss Outdated Show resolved Hide resolved
components/HomeSection/HomeSection.module.scss Outdated Show resolved Hide resolved
backgroundColor: 'white',
borderBottom: 'none',
borderRadius: 24,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pill shape of the button does not match any other button's style on the site, so let's remove this.

Suggested change
borderRadius: 24,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The site navigation and the "Scroll to Learn More" button have a more circular shape.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only on hover. The header follows that pattern to match the search box. The hero does it to match the header because of proximity. Neither area really "buttons." All elements that look like buttons should follow the Material guidelines as per the MUI <Button/> component.

styles/pages/index.module.scss Outdated Show resolved Hide resolved
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
justify-items: center;
grid-gap: 3rem;
grid-template-columns: repeat(auto-fit, minmax(var(--col-size), 1fr));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not use CSS variables here and be explicit here and in the media query. I get what you're doing here, but its just not a pattern we've done in this repo.

}

.content {
.image {
position: relative;
transition: all .2s linear;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to remove this transition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Transition smoothes the behavior of the icon when hovering over the card.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I'm asking is to remove all transitions from those cards. Keep the style as you have proposed before hover, but make the buttons the only clickable areas. 😄

@andrejsharapov
Copy link
Contributor Author

Looks like it's done)

Note Several interesting observations.

  1. This turned out to be a little more difficult than I thought for several reasons: I stopped using pixels in my work a long time ago and work with rem and/or em more often. Plus, you're using px and rem on the same "system":
// variables.scss
// px
$tablet-width: 910px;
$mobile-width: 736px;
// but rem
$width-max: 96rem;
  1. And yet, the choice of such breakpoints is not entirely clear to me, they are very different from the generally accepted ones (768, 992, 1024, 1200, etc.).
  2. In some places it is preferable to use variables than to duplicate code with different values.
  3. Many places use questionable pixels like 5/30/33/175 and others. It would be nice to translate them to 4/8/32...

In general, I liked the work. I'll suggest more improvements over time if you don't mind.

@mririgoyen mririgoyen mentioned this pull request Feb 2, 2023
@mririgoyen
Copy link
Member

Definitely, we love suggestions, feedbacks, and PRs.

My apologies about some of the inconsistencies in terms of px/rem. The site was put together by myself over the past 2 months. When there's a lot to do, sometimes details slip through the cracks. There's still a lot to do in terms of features and in terms of Developer Experience.

Let's see if I can address/justify any of your concerns and see if we can find places for improvement.

  1. My philosophy on pixels vs rems is like comparing inches to centimeters. For general "good enough" cases, rems typically do fine. I tend to use rems for padding, margin, gaps, etc., anything that doesn't need to be too precise. Rems or vh/vw always get used for font-sizes for obvious reasons. When you need that precision, pixels are much easier to work with. (e.g. 1px vs 0.0625rem) It's less to write, it's easier, it's less bytes in the file. All that being said, there are definitely some inconsistencies that could be cleaned up following that mantra.

  2. There is no hard-and-fast rule on breakpoints. There's lots of information on approximate screen resolution ranges for different devices, but when it comes down to it, breakpoints need to make sense to the website. In our case, the breakpoints are close to the top of the range for each device, but are adjusted slightly to better handle the content we're offering without having to make a ton of little one-off rules.

  3. I agree here and think we can improve on this, but we should do it all at once and then remain consistent.

  4. I'm not sure I understand your concern exactly, why are 5/30/33/175 questionable?

@andrejsharapov
Copy link
Contributor Author

andrejsharapov commented Feb 2, 2023

I'm not sure I understand your concern exactly, why are 5/30/33/175 questionable?

Try to avoid odd numbers. You have probably noticed that many modern grids, fonts, and others use even values that are multiples of 4 (8, 12, 16, 24). The Material also uses these values. MUI used on this site is also built on this system. This will also be useful for the future margin/padding system.

This applies to point 1 as well. px is best used to set the size of decorative elements, e.g. border-width, but and here I'd better apply the thin, medium or thick, for everything else (margins, padding, max-/width, media query, font-size etc - rem.

Indents of 12, 16, 24, 32, 48, 56px and above are easier to use and easy to manipulate:

11px = 0.6875rem;
// vs
12px = 0.75rem;
33px = 2.0625rem;
// vs
32px = 2rem;

or when creating variables/mixins:

$base_px = 0.25rem;
$font_size = calc(#{$base_px} * 4);

In the future, it will become easier to translate and navigate in em/rem, without 0.0000625 ✌️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants