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

fix(vite): remove discrepancy between dev and prod css imports #3282

Merged
merged 2 commits into from
Mar 4, 2024

Conversation

mlbrgl
Copy link
Member

@mlbrgl mlbrgl commented Mar 2, 2024

typography.scss is imported twice:

  • in grapher.scss
  • in owid.scss

In owid.entry.ts, we're importing owid.scss then grapher.scss. This means that typography overrides defined in owid.scss, are being themselves overridden by grapher.scss's typography rules.

Screenshot 2024-03-02 at 19.21.55.png

👆 This is an example of the issue: both .body-3-medium-italic and .homepage-intro__featured-work-authors have identical specificity (0,1,0), and yet the typography.scss line-height unexpectedly takes over.

In production, this isn't an issue since common is imported before owid.

Screenshot 2024-03-02 at 19.23.03.png

... which leads to unnecessary !important overrides, simply to fix dev.

@mlbrgl
Copy link
Member Author

mlbrgl commented Mar 2, 2024

@mlbrgl mlbrgl changed the title fix(vite): reorder dev css to match production css fix(vite): remove discrepancy between dev and prod css imports Mar 2, 2024
@mlbrgl mlbrgl force-pushed the vite-dev-css-order branch from 809470a to a8d37d4 Compare March 2, 2024 18:45
@mlbrgl mlbrgl requested a review from marcelgerber March 4, 2024 09:32
@mlbrgl mlbrgl mentioned this pull request Mar 4, 2024
24 tasks
Copy link
Member

@marcelgerber marcelgerber left a comment

Choose a reason for hiding this comment

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

Great, good catch!

@mlbrgl
Copy link
Member Author

mlbrgl commented Mar 4, 2024

thanks @marcelgerber!

@mlbrgl
Copy link
Member Author

mlbrgl commented Mar 4, 2024

Merge activity

  • Mar 4, 9:56 AM EST: @mlbrgl started a stack merge that includes this pull request via Graphite.
  • Mar 4, 9:57 AM EST: @mlbrgl merged this pull request with Graphite.

@mlbrgl mlbrgl merged commit 745c75e into master Mar 4, 2024
26 checks passed
@mlbrgl mlbrgl deleted the vite-dev-css-order branch March 4, 2024 14:57
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