Skip to content

Commit

Permalink
chore: Use Sass @use in plop template and README (#1793)
Browse files Browse the repository at this point in the history
Co-authored-by: Aram <[email protected]>
  • Loading branch information
VincentSmedinga and alimpens authored Dec 20, 2024
1 parent fa42211 commit 4f4409e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plopfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function (plop) {
type: 'append',
path: 'packages/css/src/components/index.scss',
pattern: `/* Append here */`,
template: `@import "./{{kebabCase name}}/{{kebabCase name}}";`,
template: `@use "./{{kebabCase name}}/{{kebabCase name}}";`,
},
{
type: 'add',
Expand Down
14 changes: 10 additions & 4 deletions proprietary/tokens/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,22 @@ Note that redefining the value of a token is a much better approach than redecla
## Usage in Sass

The tokens can be imported as Sass variables as well.
As they are already prefixed, the namespace that Sass would assign isn’t necessary.

```sass
@import "@amsterdam/design-system-tokens/dist/index.scss"
@use "@amsterdam/design-system-tokens/dist/index.scss" as *;
```

Import the compact tokens if you need them.
Sass will override spacious values automatically.
Import the compact tokens if needed.
Note that Sass doesn't allow importing them alongside the default set due to naming conflicts.
Address these tokens through the `compact` namespace and do not use the spacious tokens they replace.

```sass
@import "@amsterdam/design-system-tokens/dist/compact.scss"
@use "@amsterdam/design-system-tokens/dist/compact.scss";
.class {
padding-block: compact.$ams-space-md;
}
```

## Usage in JavaScript
Expand Down

0 comments on commit 4f4409e

Please sign in to comment.