-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NOJIRA]: Migrate to sass-embedded (#3103)
* [NOJIRA]: Prepare for sass-embedded * [NO-JIRA]: Fixed dependencies * [NO-JIRA]: removed css files * [NOJIRA]: added scripts * [NOJIRA]: replace imports * [NOJIRA]: apply sass-migrator to examples * [NOJIRA]: fix webpack * [NOJIRA]: fix lint * [NOJIRA]: fix lint 2 * [NOJIRA]: Granular imports * [NOJIRA]: base.css * [NOJIRA]: icons.scss header * [NOJIRA]: flatten mixins * [NOJIRA]: fix * [NOJIRA]: forwarding fix * [NOJIRA]: Adapt to the changes in main * [NOJIRA]: Rename unstable mixins folder * [NOJIRA]: Post-rename cleanup * [NOJIRA]: Add decision doc * [NOJIRA]: Added linting rule and disabled it for allowed usages * [NOJIRA]: fix * [NOJIRA]: fix stylesheets * [NOJIRA]: fix normalize * [NOJIRA]: Fix transpile script * [NOJIRA]: Fix and bump dependencies * [NOJIRA]: Updated Contributing.md * [NOJIRA]: SCSS Cleanup * [NOJIRA]: Fix storybook * [NOJIRA]: Update naming * [NOJIRA]: fix * fix * fix math * [NOJIRA]: Fix copy-utils --------- Co-authored-by: Aleksandr Sannikov <aleksandr.sannikov@skyscanner.net>
- Loading branch information
Showing
363 changed files
with
3,148 additions
and
8,898 deletions.
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.