@magnesium/core
Version:
The Magnesium Design components for the web core system.
88 lines (63 loc) • 1.57 kB
Markdown
# @magnesium/core
The Magnesium Design core system.
## Installing
```shell
npm install @magnesium/core
```
## Usage
```scss
```
### Configuration
You can extend default options before importing any Magnesium components:
```scss
```
### Options
| Name | Default | Description |
|-----------|----------------------------------------|----------------------------------------------|
| `screens` | `()` | Sets a map of token rules for media queries. |
| `core` | `("responsive": true, "states": true)` | Sets a map of token rules for core rules. |
### Screens
```scss
```
### Core
```scss
```
## API
### Sass functions
| Function | Description |
|--------------------------------|-------------------------------------------------------|
| `create-var($name, $fallback)` | Sets new CSS custom property, with optional fallback. |
#### Color with `core.create-var()`
The following Sass...
```scss
.foo {
color: core.create-var(foo, #2674a2);
}
```
...will produce the following CSS...
```css
.foo {
color: var(--mg-foo, #2674a2);
}
```