-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from MatteuSan/dev/v1
1.0.0
- Loading branch information
Showing
57 changed files
with
3,106 additions
and
3,344 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 |
---|---|---|
@@ -0,0 +1,126 @@ | ||
--- | ||
title: Breakpoint Module API | ||
slug: /api/breakpoints | ||
--- | ||
|
||
# Breakpoint API | ||
|
||
## `breakpoint-config()` mixin | ||
|
||
Adds breakpoints to the design system. | ||
|
||
There are two parameters to this mixin. The first one is to insert a pre-made breakpoint map. It could be from the design | ||
team, or from the project's UX lead. Then the second one is for adding your own breakpoints. | ||
|
||
Both parameters can be used simultaneously, or if you don't want that you can always use one or the other. | ||
|
||
### Syntax | ||
|
||
```scss | ||
/// @param {map} $token-map | ||
/// @param {args} $breakpoints... | ||
breakpoint-config($map: (), $breakpoints...) {} | ||
``` | ||
|
||
### Usage | ||
|
||
```scss | ||
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme'); | ||
|
||
:root { | ||
@include sentro.token-config( | ||
$small: 320px, | ||
$medium: 677px, | ||
$large: 890px, | ||
$xlarge: 1077px | ||
); | ||
} | ||
|
||
... | ||
``` | ||
|
||
## `breakpoint-check()` function | ||
|
||
Checks if a breakpoint is a valid breakpoint or not. Must be used within a valid SCSS conditional statement. | ||
|
||
**NOTE: It does not throw and error when the value is asserted as false, you need to make the error yourself.** | ||
|
||
### Syntax | ||
|
||
```scss | ||
/// @param {*} query | ||
breakpoint-check($query) {} | ||
``` | ||
|
||
### Usage | ||
|
||
```scss | ||
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme'); | ||
|
||
@function tell-me-if-its-a-breakpoint($breakpoint) { | ||
@if sentro.breakpoint-check($breakpoint) { | ||
@return 'IT IS A BREAKPOINT!'; | ||
} @else { | ||
@return 'Oh, that\'s disappointing...'; | ||
} | ||
} | ||
|
||
... | ||
``` | ||
|
||
## `breakpoint-create()` mixin | ||
|
||
Creates a breakpoint. Must be used within a valid CSS selector. | ||
|
||
### Syntax | ||
|
||
```scss | ||
/// @param {string} $key | ||
/// @param {*} $value | ||
breakpoint-create($key, $value) {} | ||
``` | ||
|
||
### Usage | ||
|
||
```scss | ||
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme'); | ||
|
||
dialog { | ||
// CSS Styles | ||
|
||
@include sentro.breakpoint-create('medium') { | ||
// CSS Styles | ||
} | ||
} | ||
|
||
... | ||
``` | ||
|
||
## `breakpoint-get()` function | ||
|
||
Queries and retrieves a breakpoint. Must be used as a property value, css-function value, or key-fallback value. | ||
|
||
Allows you to query your own breakpoint and pass it off inside a property to be used. | ||
|
||
### Syntax | ||
|
||
```scss | ||
/// @param {string} $key | ||
token-get($key) {} | ||
``` | ||
|
||
### Usage | ||
|
||
```scss | ||
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme'); | ||
|
||
dialog { | ||
// CSS Styles | ||
|
||
@media (min-width: sentro.breakpoint-get('medium')) { | ||
// CSS Styles | ||
} | ||
} | ||
|
||
... | ||
``` |
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,132 @@ | ||
--- | ||
title: Keys Module API | ||
slug: /api/keys | ||
--- | ||
|
||
# Keys API | ||
|
||
## `key-bind()` mixin | ||
|
||
Binds a new value to an existing key. Must be used within a valid CSS selector. | ||
|
||
### Syntax | ||
|
||
```scss | ||
/// @param {string} $key | ||
/// @param {*} $value | ||
key-bind($key, $value) {} | ||
``` | ||
|
||
### Usage | ||
|
||
```scss | ||
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme'); | ||
|
||
.sdc-card { | ||
@include sentro.key-bind('card-bg', sentro.token-switch('surface-light')); | ||
} | ||
|
||
... | ||
``` | ||
|
||
## `key-create()` function | ||
|
||
Creates a key with a fallback value for a CSS property. Must be used as a property value, css-function value, or | ||
key-fallback value. | ||
|
||
### Syntax | ||
|
||
```scss | ||
/// @param {string} $key | ||
/// @param {*} $value | ||
key-create($key, $value) {} | ||
``` | ||
|
||
### Usage | ||
|
||
```scss | ||
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme'); | ||
|
||
.sdc-card { | ||
background: sentro.key-create('card-bg', sentro.token-switch('surface-light')); | ||
} | ||
|
||
... | ||
``` | ||
|
||
## `key-check()` function | ||
|
||
Checks if a token is a valid key or not. Must be used within a valid SCSS conditional statement. | ||
|
||
**NOTE: It does not throw and error when the value is asserted as false, you need to make the error yourself.** | ||
|
||
### Syntax | ||
|
||
```scss | ||
/// @param {*} $query | ||
key-check($query) {} | ||
``` | ||
|
||
### Usage | ||
|
||
```scss | ||
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme'); | ||
|
||
@function tell-me-if-its-a-key($key) { | ||
@if sentro.key-check($key) { | ||
@return 'IT IS A KEY!'; | ||
} @else { | ||
@return 'Oh, that\'s disappointing...'; | ||
} | ||
} | ||
|
||
... | ||
``` | ||
|
||
## `key-get()` function | ||
|
||
Queries and retrieves a key in its CSS custom property form. Must be used as a property value, css-function value, or | ||
key-fallback value. | ||
|
||
### Syntax | ||
|
||
```scss | ||
/// @param {string} $key | ||
key-get($key) {} | ||
``` | ||
|
||
### Usage | ||
|
||
```scss | ||
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme'); | ||
|
||
.sdc-card { | ||
background: sentro.key-get('card-bg'); | ||
} | ||
|
||
... | ||
``` | ||
|
||
## `key-get-raw()` function | ||
|
||
Queries and retrieves a key in its raw value form. Must be used as a property value, css-function value, or key-fallback | ||
value. | ||
|
||
### Syntax | ||
|
||
```scss | ||
/// @param {string} $key | ||
key-get-raw($key) {} | ||
``` | ||
|
||
### Usage | ||
|
||
```scss | ||
@use 'node_modules/@matteusan/sentro' with ($prefix: 'sdc', $context: 'theme'); | ||
|
||
.sdc-card { | ||
background: sentro.key-get-raw('card-bg'); | ||
} | ||
|
||
... | ||
``` |
Oops, something went wrong.