Skip to content

Commit

Permalink
UPDATE: Update to pkg: import statements
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteuSan committed May 1, 2024
1 parent 2c5d407 commit 69cf2dc
Show file tree
Hide file tree
Showing 25 changed files with 1,128 additions and 2,794 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ npm install @matteusan/sentro --save
## Showcase
#### SCSS Input
```scss
@use '@matteusan/sentro' with (
@use 'pkg:@matteusan/sentro' with (
$prefix: 'sdc',
$context: 'theme'
);
Expand Down
8 changes: 4 additions & 4 deletions docs/api/breakpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ breakpoint-config($map: (), $breakpoints...) {}
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

:root {
@include sentro.token-config(
Expand Down Expand Up @@ -55,7 +55,7 @@ breakpoint-check($query) {}
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

@function tell-me-if-its-a-breakpoint($breakpoint) {
@if sentro.breakpoint-check($breakpoint) {
Expand Down Expand Up @@ -83,7 +83,7 @@ breakpoint-create($key, $value) {}
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

dialog {
// CSS Styles
Expand Down Expand Up @@ -112,7 +112,7 @@ token-get($key) {}
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

dialog {
// CSS Styles
Expand Down
10 changes: 5 additions & 5 deletions docs/api/keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ key-bind($key, $value) {}
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

.sdc-card {
@include sentro.key-bind('card-bg', sentro.token-switch('surface-light'));
Expand All @@ -45,7 +45,7 @@ key-create($key, $value) {}
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

.sdc-card {
background: sentro.key-create('card-bg', sentro.token-switch('surface-light'));
Expand All @@ -70,7 +70,7 @@ key-check($query) {}
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

@function tell-me-if-its-a-key($key) {
@if sentro.key-check($key) {
Expand Down Expand Up @@ -98,7 +98,7 @@ key-get($key) {}
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

.sdc-card {
background: sentro.key-get('card-bg');
Expand All @@ -122,7 +122,7 @@ key-get-raw($key) {}
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

.sdc-card {
background: sentro.key-get-raw('card-bg');
Expand Down
10 changes: 5 additions & 5 deletions docs/api/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ It accepts a string. This will be the separator for your tokens. By default, it
This is specifically useful if your design system specifications call for a different separator for tokens. For example, you want to use `.` instead of `-` for your tokens. You can set it like this:

```scss
@use 'node_modules/@matteusan/sentro' with (
@use 'pkg:@matteusan/sentro' with (
$prefix: 'sdc',
$context: 'theme',
$separator: '.' // uses . instead of - to separate tokens.
Expand All @@ -46,7 +46,7 @@ body {
The scope of this setting is not only exclusive to tokens but also to keys and breakpoints:

```scss
@use 'node_modules/@matteusan/sentro' with (
@use 'pkg:@matteusan/sentro' with (
$prefix: 'sdc',
$context: 'theme',
$separator: '.'
Expand Down Expand Up @@ -97,7 +97,7 @@ It accepts a boolean value. This will enable/disable token validation throughout
Use it upon using the module in the root stylesheet.

```scss
@use 'node_modules/@matteusan/sentro' with (
@use 'pkg:@matteusan/sentro' with (
$prefix: 'sdc',
$context: 'theme',
$token-validation: false
Expand All @@ -111,7 +111,7 @@ It accepts a boolean value. This will enable/disable key validation throughout t
Use it upon using the module in the root stylesheet.

```scss
@use 'node_modules/@matteusan/sentro' with (
@use 'pkg:@matteusan/sentro' with (
$prefix: 'sdc',
$context: 'theme',
$key-validation: false
Expand All @@ -122,7 +122,7 @@ Use it upon using the module in the root stylesheet.
It accepts a character. This will be the default token separator for your entire design system.

```scss
@use 'node_modules/@matteusan/sentro' with (
@use 'pkg:@matteusan/sentro' with (
$prefix: 'sdc',
$context: 'theme',
$default-separator: '.' // uses . instead of - to separate tokens.
Expand Down
4 changes: 2 additions & 2 deletions docs/api/throw.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Throws an error. Must be used within a valid SCSS conditional statement or a val
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

.sdc-card {
@if sentro.key-check('card-bg') {
Expand Down Expand Up @@ -53,7 +53,7 @@ Throws a warning. Must be used within a valid SCSS conditional statement or a va
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

.sdc-card {
@if sentro.key-check('card-bg') {
Expand Down
14 changes: 7 additions & 7 deletions docs/api/tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ token-config($map: (), $tokens...) {}
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

:root {
@include sentro.token-config(
Expand Down Expand Up @@ -57,7 +57,7 @@ token-check($query) {}
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

@function tell-me-if-its-a-token($token) {
@if sentro.token-check($token) {
Expand Down Expand Up @@ -88,7 +88,7 @@ token-create($key, $value) {}
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

:root {
@include sentro.token-create('brand-color-light', #ff7700);
Expand All @@ -114,7 +114,7 @@ token-get($key) {}
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

.my-selector {
background-color: sentro.token-get('brand-color-light');
Expand Down Expand Up @@ -142,7 +142,7 @@ token-get-raw($key) {}
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

.my-selector {
background-color: rgba(sentro.token-get-raw('brand-color-light'), 70%);
Expand All @@ -166,7 +166,7 @@ token-switch($query, $fallback: ()) {}
```
### Usage
```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

$fill: #ff7700 !default;

Expand Down Expand Up @@ -195,7 +195,7 @@ token-switch-raw($query, $fallback: ()) {}
### Usage

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

$fill: #ff7700 !default;

Expand Down
12 changes: 6 additions & 6 deletions docs/breakpoints/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Configure your breakpoints using the `sentro.breakpoint-config()` mixin.
- For maps, the `default` key is the set non-variant key for the parent key (please see the examples below).

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

@include sentro.breakpoint-config(
$small: 320px,
Expand All @@ -26,7 +26,7 @@ Configure your breakpoints using the `sentro.breakpoint-config()` mixin.
The `breakpoint-config()` mixin also supports map-based token sets using the `$map` parameter.

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

$_my-breakpoint-map: (
small: 320px,
Expand All @@ -46,7 +46,7 @@ $_my-breakpoint-map: (
You can also nest breakpoints within each other.

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

$_my-breakpoint-map: (
mobile: (
Expand Down Expand Up @@ -75,7 +75,7 @@ You can use these breakpoints by doing this:
It also supports both at the same time.

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

$_my-breakpoint-map: (
large: 890px,
Expand All @@ -94,7 +94,7 @@ $_my-breakpoint-map: (
When using the breakpoints in your CSS, you are going to use the `breakpoint-create()` mixin. It takes in a valid breakpoint token you've configured in the `breakpoint-config()` mixin.

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

$_my-breakpoint-map: (
small: 320px,
Expand All @@ -119,7 +119,7 @@ When you want a specific type of breakpoint in your CSS, you can use the same mi
- `$property` refers to what property to watch for. The usual values for this property are `'width'` and `'height'` with the default being `'height'`.

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

$_my-breakpoint-map: (
small: 320px,
Expand Down
12 changes: 6 additions & 6 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ npm install @matteusan/sentro --save
In your main SCSS stylesheet, use the `@use` at-rule to use the library.

```scss
@use 'node_modules/@matteusan/sentro';
@use 'pkg:@matteusan/sentro';
```

Then configure the **prefix** to be used and the **context** in your design system using the `with ()` sass feature.
Expand All @@ -27,7 +27,7 @@ Then configure the **prefix** to be used and the **context** in your design syst
- **Context** provides an additional unique prefix for your tokens (e.g. `'token'`, `'theme'`, etc.)

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
```

### When using it in partials
Expand All @@ -37,10 +37,10 @@ requires you to configure the `$prefix` and `$context` once in your main SCSS fi

```scss
// main.scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

// _partial.scss
@use 'node_modules/@matteusan/sentro';
@use 'pkg:@matteusan/sentro';
```

The case is different for SCSS files that are not partials and will not get used/imported in the main SCSS file. You
Expand All @@ -49,10 +49,10 @@ the main SCSS file.

```scss
// main.scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

// my-component.scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'my-component');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'my-component');
```

As seen above, we recommend that the `$context` value is the same as the component name.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Sentro is well-equipped for making your design system into a production ready de
## Showcase
#### SCSS Input
```scss
@use '@matteusan/sentro' with (
@use 'pkg:@matteusan/sentro' with (
$prefix: 'sdc',
$context: 'theme'
);
Expand Down
4 changes: 2 additions & 2 deletions docs/selector/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The selector module is a powerful tool for selecting elements in the DOM. It all
Create a selector using the `sentro.selector-create()` mixin.

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

@include sentro.selector-create('.button') {
// Your styles here
Expand All @@ -30,7 +30,7 @@ And it outputs:
You can nest selectors using the `&` symbol.

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

@include sentro.selector-create('.button') {
// Your base styles here
Expand Down
4 changes: 2 additions & 2 deletions docs/throw/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Throwing an error is as simple as calling the `sentro.throw-error()` mixin with

```scss
// main.scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

@debug sentro.throw-error('This is an error message.', 'main.scss');
```
Expand All @@ -28,7 +28,7 @@ Throwing a warning is as simple as calling the `sentro.throw-warn()` mixin with

```scss
// main.scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

@debug sentro.throw-warn('This is a warning message.', 'main.scss');
```
Expand Down
6 changes: 3 additions & 3 deletions docs/tokens/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Configure your tokens using the `sentro.token-config()` mixin.
It can be a map with a default value and variants, or a separate variable argument. For maps, the `default` key is the set non-variant key for the parent key (please see the examples below).

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

:root {
@include sentro.token-config(
Expand All @@ -36,7 +36,7 @@ It can be a map with a default value and variants, or a separate variable argume
The `token-config()` mixin also supports map-based token sets using the `$map` parameter.

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

$_my-token-map: (
'brand-color': (
Expand All @@ -63,7 +63,7 @@ $_my-token-map: (
It also supports both at the same time.

```scss
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');
@use 'pkg:@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme');

$_my-token-map: (
'brand-color': (
Expand Down
Loading

0 comments on commit 69cf2dc

Please sign in to comment.