Skip to content

Commit

Permalink
fix: ensure @import rules are before any other styles (#1611)
Browse files Browse the repository at this point in the history
* fix: ensure @import rules are before any other styles

Resolves warnings in consuming apps, and prevents duplicate @import entries for teh same font.

https://czi-tech.atlassian.net/browse/EFI-1094

* chore: fix spaces
  • Loading branch information
ahuth authored May 11, 2023
1 parent 1c12d9f commit 855f691
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/design-tokens/external-fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600&display=swap');
5 changes: 2 additions & 3 deletions src/design-tokens/mixins.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import '../design-tokens/tier-2-usage/typography-usage.css';
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600&display=swap');

/**
* Link button styles
Expand Down Expand Up @@ -27,7 +26,7 @@

&:focus-visible {
/**
* Make the focus outline invisible but don't remove it. High contrast mode will remove the background
* Make the focus outline invisible but don't remove it. High contrast mode will remove the background
* color, but it will also make borders 100% opacity black.
*/
outline: 1px solid transparent;
Expand All @@ -41,7 +40,7 @@
@supports not selector(:focus-visible) {
&:focus {
/**
* Make the focus outline invisible but don't remove it. High contrast mode will remove the background
* Make the focus outline invisible but don't remove it. High contrast mode will remove the background
* color, but it will also make borders 100% opacity black.
*/
outline: 1px solid transparent;
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Ensure @import rules for fonts are before anything else. Otherwise build tools can show warnings
// in consuming apps.
import './design-tokens/external-fonts.css';
// This brings the style tokens that are css custom variables into the built stylesheet so only one stylesheet for EDS has to be imported.
import './tokens-dist/css/variables.css';

Expand Down

0 comments on commit 855f691

Please sign in to comment.