This repository has been archived by the owner on Feb 11, 2022. It is now read-only.
Replace @import with @use rules as the import rules will be deprecated later this year #712
Merged
schalkneethling
merged 15 commits into
mdn:main
from
tannerdolby:replace-import-with-use-rules
Aug 2, 2021
Merged
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
87c5006
Create index files and use @forward rules
tannerdolby 49c418f
Replace @import with @use for shared-variables module
tannerdolby f88ec84
Replace @import rules with @use for mdn-minimalist.scss
tannerdolby d620ae4
Removes last import rules in mdn-miniamlist.scss
tannerdolby c4ffc56
Load the vars module without a namespace
tannerdolby 781b5c7
Add use rules to load modules without a namespace
tannerdolby eae30a3
Update module path for index file in /atoms directory
tannerdolby f65a11b
Replace last few import rules in styleguide and test
tannerdolby 0b68c90
Add extra newline to end of index files so linter is happy
tannerdolby 6015eda
Make tests pass
tannerdolby 7231526
Resolving namespace conflicts in test.scss
tannerdolby 3cc1974
Cleanup test.scss, wrangle last pesky error in test suite
tannerdolby 664d35d
Update the namespace for test-mixins-* modules
tannerdolby 9c7f844
Try using import rules to see if describe is defined
tannerdolby bca1475
make tests pass
tannerdolby File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
@use "../vars" as *; | ||
@use "../mixins" as *; | ||
|
||
html { | ||
background-color: $white; | ||
box-sizing: border-box; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
@use "sass:math"; | ||
@use "../mixins/" as *; | ||
@use "../vars/" as *; | ||
|
||
blockquote { | ||
@include blockquote(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
@use "sass:math"; | ||
@use "../mixins/" as *; | ||
@use "../vars/" as *; | ||
|
||
.button, | ||
a.button { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@use "sass:math"; | ||
@use "../vars/" as *; | ||
|
||
code { | ||
background-color: $mdn-neutral100; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@use "sass:math"; | ||
@use "../vars/" as *; | ||
|
||
.sample-code-frame { | ||
border: $thin-primary-border; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@use "../vars/" as *; | ||
|
||
form { | ||
.field-group { | ||
margin-bottom: 20px; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@use "sass:math"; | ||
@use "../vars/" as *; | ||
|
||
.icon { | ||
background-position: 0 0; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@forward "../atoms/base"; | ||
@forward "../atoms/typography"; | ||
@forward "../atoms/blockquote"; | ||
@forward "../atoms/links"; | ||
@forward "../atoms/lists"; | ||
@forward "../atoms/icons"; | ||
@forward "../atoms/callout"; | ||
@forward "../atoms/notifications"; | ||
@forward "../atoms/meta"; | ||
@forward "../atoms/pre"; | ||
@forward "../atoms/code"; | ||
@forward "../atoms/kbd"; | ||
@forward "../atoms/buttons"; | ||
@forward "../atoms/buttons-ghost"; | ||
@forward "../atoms/forms"; | ||
@forward "../atoms/tables"; | ||
@forward "../atoms/properties-table"; | ||
@forward "../atoms/overlays"; | ||
@forward "../atoms/utils"; | ||
@forward "../atoms/examples"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
@use "sass:math"; | ||
@use "../vars/" as *; | ||
@use "../mixins/" as *; | ||
|
||
a { | ||
color: $link-color; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@use "../vars/" as *; | ||
|
||
dl { | ||
dt { | ||
font-weight: bold; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@use "sass:math"; | ||
@use "../vars/" as *; | ||
|
||
/* General Badges */ | ||
.badge { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@use "../vars/" as *; | ||
|
||
/* notification text styles */ | ||
.neutral { | ||
color: $mdn-blue600; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@use "../vars/" as *; | ||
|
||
pre { | ||
background-color: $mdn-neutral100; | ||
border-left: $code-example-border; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
@use "sass:math"; | ||
@use "../mixins/" as *; | ||
@use "../vars/" as *; | ||
|
||
/* | ||
* Property tables, for an example see : | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
@use "sass:math"; | ||
@use "../mixins/" as *; | ||
@use "../vars/" as *; | ||
|
||
table { | ||
border: $standard-light-border; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
@use "../mixins/" as *; | ||
@use "../vars/" as *; | ||
|
||
@font-face { | ||
font-display: swap; | ||
font-family: zillaslab; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
@use "../mixins/" as *; | ||
/* | ||
* Hide an element visually, but not from screen readers | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,5 @@ | ||
@import "./lib/reset"; | ||
|
||
@import "./vars/mdn-web-docs-palette"; | ||
@import "./vars/backgrounds"; | ||
@import "./vars/color-gradients"; | ||
@import "./vars/layout"; | ||
@import "./vars/borders"; | ||
@import "./vars/shadows"; | ||
@import "./vars/typography"; | ||
|
||
@import "./mixins/animation"; | ||
@import "./mixins/buttons"; | ||
@import "./mixins/links"; | ||
@import "./mixins/typography"; | ||
@import "./mixins/utils"; | ||
|
||
@import "./atoms/base"; | ||
@import "./atoms/typography"; | ||
@import "./atoms/blockquote"; | ||
@import "./atoms/links"; | ||
@import "./atoms/lists"; | ||
@import "./atoms/icons"; | ||
@import "./atoms/callout"; | ||
@import "./atoms/notifications"; | ||
@import "./atoms/meta"; | ||
@import "./atoms/pre"; | ||
@import "./atoms/code"; | ||
@import "./atoms/kbd"; | ||
@import "./atoms/buttons"; | ||
@import "./atoms/buttons-ghost"; | ||
@import "./atoms/forms"; | ||
@import "./atoms/tables"; | ||
@import "./atoms/properties-table"; | ||
@import "./atoms/overlays"; | ||
@import "./atoms/utils"; | ||
@import "./atoms/examples"; | ||
|
||
@import "./utils/utils"; | ||
@use "sass:math"; | ||
@use "./vars" as *; | ||
@use "./atoms" as *; | ||
@use "./lib/reset"; | ||
@use "./utils/utils"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@forward "./animation"; | ||
@forward "./buttons"; | ||
@forward "./links"; | ||
@forward "./typography"; | ||
@forward "./utils"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@forward "./backgrounds"; | ||
@forward "./borders"; | ||
@forward "./color-gradients"; | ||
@forward "./layout"; | ||
@forward "./mdn-web-docs-palette"; | ||
@forward "./shadows"; | ||
@forward "./typography"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@use "./mdn-web-docs-palette" as *; | ||
|
||
$button-active-state-shadow: 1px 1px 0 3px $mdn-blue300, | ||
-1px -1px 0 3px $mdn-blue300; | ||
$light-gray-shadow: 0 1px 2px 1px $mdn-neutral200; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
@use "../vars/" as *; | ||
|
||
ul.swatch-library { | ||
display: flex; | ||
flex-wrap: wrap; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
@import "../../sass/vars/mdn-web-docs-palette"; | ||
@import "./vars/layout"; | ||
@import "../../sass/vars/typography"; | ||
@use "../../sass/vars/mdn-web-docs-palette"; | ||
@use "./vars/layout"; | ||
@use "../../sass/vars/typography"; | ||
|
||
@import "./utils/layout"; | ||
@use "./utils/layout"; | ||
|
||
@import "./atoms/logo"; | ||
@import "./atoms/samples"; | ||
@import "./atoms/tables"; | ||
@use "./atoms/logo"; | ||
@use "./atoms/samples"; | ||
@use "./atoms/tables"; | ||
|
||
@import "./molecules/button-gallery"; | ||
@import "./molecules/swatch-library"; | ||
@import "./molecules/toc"; | ||
@use "./molecules/button-gallery"; | ||
@use "./molecules/swatch-library"; | ||
@use "./molecules/toc"; | ||
|
||
@import "./organisms/main"; | ||
@import "./organisms/footer"; | ||
@use "./organisms/main"; | ||
@use "./organisms/footer"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
/* Requirements */ | ||
@import "../../node_modules/sass-true/sass/true"; | ||
|
||
@import "../../sass/vars/mdn-web-docs-palette"; | ||
@import "../../sass/vars/layout"; | ||
@import "../../sass/vars/typography"; | ||
|
||
@import "../../sass/mixins/buttons"; | ||
@import "../../sass/mixins/links"; | ||
@import "../../sass/mixins/typography"; | ||
@import "../../sass/mixins/utils"; | ||
|
||
@import "../../sass/atoms/buttons"; | ||
@use "../../node_modules/sass-true/sass/true"; | ||
@use "../../sass/vars/" as *; | ||
@use "../../sass/mixins/" as *; | ||
@use "../../sass/atoms/" as *; | ||
|
||
/* Tests */ | ||
@import "./test-mixins-buttons"; | ||
@import "./test-mixins-links"; | ||
@import "./test-mixins-typography"; | ||
@import "./test-mixins-utils"; | ||
@use "./test-mixins-buttons"; | ||
@use "./test-mixins-links"; | ||
@use "./test-mixins-typography"; | ||
@use "./test-mixins-utils"; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where using index files are super nice! We can simply import the entire directory of stylesheets as a single module rather than worrying about using the "expected" ones which sometimes can be a pain to keep track of.