-
Notifications
You must be signed in to change notification settings - Fork 186
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
[NOJIRA]: Migrate to sass-embedded #3103
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
785b41b
[NOJIRA]: Prepare for sass-embedded
7d630db
[NO-JIRA]: Fixed dependencies
5547c9e
[NO-JIRA]: removed css files
435d2fc
[NOJIRA]: added scripts
48dec5c
[NOJIRA]: replace imports
a851513
[NOJIRA]: apply sass-migrator to examples
0d198be
[NOJIRA]: fix webpack
5758554
[NOJIRA]: fix lint
2adfccd
[NOJIRA]: fix lint 2
e580e92
[NOJIRA]: Granular imports
dc048b5
[NOJIRA]: base.css
70de8db
[NOJIRA]: icons.scss header
0ce10a6
[NOJIRA]: flatten mixins
265291b
[NOJIRA]: fix
acebbb6
[NOJIRA]: forwarding fix
ebfd03d
[NOJIRA]: Adapt to the changes in main
c14e325
[NOJIRA]: Rename unstable mixins folder
6becec7
[NOJIRA]: Post-rename cleanup
123a20b
[NOJIRA]: Add decision doc
9d17fd0
[NOJIRA]: Added linting rule and disabled it for allowed usages
b7f2c72
[NOJIRA]: fix
03141de
[NOJIRA]: fix stylesheets
ed9fce6
[NOJIRA]: fix normalize
5079cc9
[NOJIRA]: Fix transpile script
cdb3f30
[NOJIRA]: Fix and bump dependencies
62cdcc3
[NOJIRA]: Updated Contributing.md
04048bb
[NOJIRA]: SCSS Cleanup
b3effd0
[NOJIRA]: Fix storybook
7f0b42a
[NOJIRA]: Update naming
bb4bf4d
[NOJIRA]: fix
c202524
fix
6496f2d
fix math
10aa4e5
[NOJIRA]: Fix copy-utils
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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
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 +1,3 @@ | ||
node_modules | ||
packages/unstable__bpk-mixins | ||
**/*.css |
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,59 @@ | ||
# Transition to modern SASS API | ||
|
||
## Decision | ||
Backpack is transforming the way it works with SASS to align with modern SASS API used in | ||
dart-sass and sass-embedded. Old API remains the default option, but at some point of time | ||
in the future we will switch the default API to the new one | ||
|
||
* Backpack is shipped with two versions of `bpk-mixins` package | ||
* `packages/bpk-mixins` that remains the stable option. It uses old SASS API and `@import` syntax | ||
* `packages/unstable__bpk-mixins` is a modern SASS API version compatible with `sass` and `sass-embedded` packages, but not with `node-sass` | ||
* In the future the package using Old API will be deprecated and removed and the one using New API will be promoted to stable | ||
* For our own components we use `unstable__bpk-mixins` | ||
* These mixins must be imported with `@use` at-rule | ||
* Mixins partials must be used in a granular way (use only those partials that you need to build a particular component, see "Wrong" and "Correct" examples below) | ||
* If you need to add or modify a mixin, do it in `packages/bpk-mixins`. Then run `npm run unstable__bpk-mixins` to generate a new modern version of the package | ||
|
||
## Examples | ||
|
||
**Wrong (1)** | ||
``` | ||
// BpkAwesomeComponent.module.scss | ||
|
||
@use '../unstable__bpk-mixins' as mixins; | ||
|
||
.bpk-awesome-component { | ||
margin-right: mixins.bpk-spacing-md(); | ||
} | ||
``` | ||
|
||
**Wrong (2)** | ||
``` | ||
// BpkAwesomeComponent.module.scss | ||
|
||
@import '../bpk-mixins'; | ||
|
||
.bpk-awesome-component { | ||
margin-right: bpk-spacing-md(); | ||
} | ||
``` | ||
|
||
**Correct** | ||
``` | ||
// BpkAwesomeComponent.module.scss | ||
|
||
@use '../unstable__bpk-mixins/tokens'; | ||
|
||
.bpk-awesome-component { | ||
margin-right: tokens.bpk-spacing-md(); | ||
} | ||
``` | ||
|
||
## Thinking | ||
|
||
The main reason behind such a change is to deliver modern API to consumers in a non-breaking manner. Using `unstable` prefix | ||
means that we can't guarantee that this package structure won't change before becoming stable. | ||
|
||
## Anything Else | ||
|
||
https://sass-lang.com/documentation/at-rules/use/#differences-from-import |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
Oops, something went wrong.
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.
🔥