closes #123
This commit is contained in:
parent
00058d8aa4
commit
5354f9a55f
4 changed files with 22 additions and 9 deletions
|
|
@ -5,16 +5,25 @@ import { scssVariablesToTableArray } from '../../../utils/parseCss';
|
|||
|
||||
{/* @ts-ignore */}
|
||||
import theme from '$lib/scss/tokens/variables/\_theme.scss?raw';
|
||||
import block from '$lib/scss/tokens/variables/\_block.scss?raw';
|
||||
|
||||
<Meta title="Styles/Tokens/Variables" parameters={{ ...parameters }} />
|
||||
<Meta title="Styles/Tokens/SCSS Variables" parameters={{ ...parameters }} />
|
||||
|
||||

|
||||
|
||||
# Token variables
|
||||
|
||||
These are SCSS mirrors of some of the default CSS variables used in the `Theme`. Use them in places where CSS variables cannot be used. e.g. You can write `media-queries` to target the block widths using the `block` vars, which is not possible using CSS variables.
|
||||
|
||||
<CopyTable
|
||||
title="Theme"
|
||||
header={['Variable', 'Properties']}
|
||||
body={scssVariablesToTableArray(theme)}
|
||||
copyable={[true, false]}
|
||||
/>
|
||||
<CopyTable
|
||||
title="Block"
|
||||
header={['Variable', 'Properties']}
|
||||
body={scssVariablesToTableArray(block)}
|
||||
copyable={[true, false]}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
$column-width-narrower: 330px !default;
|
||||
$column-width-narrow: 510px !default;
|
||||
$column-width-normal: 660px !default;
|
||||
$column-width-wide: 930px !default;
|
||||
$column-width-wider: 1200px !default;
|
||||
@use '../tokens/variables/block' as *;
|
||||
|
||||
@mixin block-snap-widths($article-padding: 30px) {
|
||||
width: $column-width-narrower;
|
||||
|
|
@ -52,11 +48,12 @@ $column-width-wider: 1200px !default;
|
|||
}
|
||||
}
|
||||
|
||||
&.widest, &.fluid {
|
||||
&.widest,
|
||||
&.fluid {
|
||||
width: inherit;
|
||||
}
|
||||
|
||||
|
||||
&.fluid {
|
||||
width: calc(100% + $article-padding);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
6
src/scss/tokens/variables/_block.scss
Normal file
6
src/scss/tokens/variables/_block.scss
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
// SCSS mirrors for default block widths
|
||||
$column-width-narrower: 330px !default;
|
||||
$column-width-narrow: 510px !default;
|
||||
$column-width-normal: 660px !default;
|
||||
$column-width-wide: 930px !default;
|
||||
$column-width-wider: 1200px !default;
|
||||
|
|
@ -1 +1,2 @@
|
|||
@forward 'theme';
|
||||
@forward 'block';
|
||||
|
|
|
|||
Loading…
Reference in a new issue