This commit is contained in:
Prasanta Kumar Dutta 2023-09-20 14:28:59 +05:30
parent 00058d8aa4
commit 5354f9a55f
4 changed files with 22 additions and 9 deletions

View file

@ -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 }} />
![](https://graphics.thomsonreuters.com/style-assets/images/logos/reuters-graphics-logo/svg/graphics-logo-color-dark.svg)
# 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]}
/>

View file

@ -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);
}
}
}

View 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;

View file

@ -1 +1,2 @@
@forward 'theme';
@forward 'block';