diff --git a/addons/rose/stories/colors.stories.mdx b/addons/rose/stories/colors.stories.mdx index 1026c131e..e7b7a3c28 100644 --- a/addons/rose/stories/colors.stories.mdx +++ b/addons/rose/stories/colors.stories.mdx @@ -1,5 +1,7 @@ import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; import { hbs } from 'ember-cli-htmlbars'; +import { action } from '@storybook/addon-actions'; +import { text, boolean, select } from '@storybook/addon-knobs'; diff --git a/addons/rose/stories/sizing.stories.mdx b/addons/rose/stories/sizing.stories.mdx new file mode 100644 index 000000000..641eadd37 --- /dev/null +++ b/addons/rose/stories/sizing.stories.mdx @@ -0,0 +1,93 @@ +import { Meta, Story, Preview } from '@storybook/addon-docs/blocks'; +import { hbs } from 'ember-cli-htmlbars'; +import { action } from '@storybook/addon-actions'; +import { text, boolean, select } from '@storybook/addon-knobs'; + + + +# Sizing + +Use sizing function for things like margins, +padding, and borders. Sizes are returned in rem units rather than +pixels, but have been calibrated with pixel equivalents in mind. + +To use the rems sizing function, first import the sizing module, +then use it in your code wherever you normally specify a size. For example... + +```scss +@import "variables/sizing"; +border: sizing.rems(xxxxs) solid; +``` + +
| Name | +PX Equiv. | +SCSS | +
|---|---|---|
xxl |
+48 | +sizing.rems(xxl) |
+
xl |
+36 | +sizing.rems(xl) |
+
l |
+24 | +sizing.rems(l) |
+
m |
+16 | +sizing.rems(m) |
+
s |
+12 | +sizing.rems(s) |
+
xs |
+8 | +sizing.rems(xs) |
+
off-xs |
+5 | +sizing.rems(off-xs) |
+
xxs |
+4 | +sizing.rems(xxs) |
+
xxxs |
+2 | +sizing.rems(xxxs) |
+
xxxxs |
+1 | +sizing.rems(xxxxs) |
+
- Find the color you need and copy the CSS custom property variable into - your stylesheet. - Use only these variables when specifying colors. This ensures - consistency and dark mode compatibility. -
-- These colors depend on light or dark mode. Use these most often - when specifying primary foreground and backround colors. -
-var(--subtle)
- var(--stark)
- - Colors sometimes don't change in dark mode. Use these - values sparingly. -
-var(--white)
- var(--black)
- var(--{{color}})
- var(--{{color}})
- var(--{{color}})
- var(--{{color}})
- var(--{{color}})
- var(--{{color}})
- var(--{{color}})
- - Use sizing function for things like margins, - padding, and borders. Sizes are returned in rem units rather than - pixels, but have been calibrated with pixel equivalents in mind. -
-- To use the rems sizing function, first import the sizing module, - then use it in your code wherever you normally specify a size: -
--@import "variables/sizing"; -border: sizing.rems(xxxxs) solid;-
| Name | -PX Equiv. | -SCSS | -
|---|---|---|
- {{size.code}}
- |
- {{size.pixels}} | -
- sizing.rems({{size.code}})
- |
-
- Paragraphs and headings are preconfigured for typography and margin. -
-
- To specify custom typography, use the SCSS variables and mixin.
- The type mixin accepts two parameters: a font size name
- (required) and an optional font weight name (normal, semibold, bold).
- This mixin sets both font size and line height, and optionally weight.
-
-@import "utilities/type";
-.my-component {
- @include type.type(m, bold);
-}
- | Name | -Font Size | -SCSS | -Note | -
|---|---|---|---|
- {{size.code}}
- |
- {{size.pixels}} | -
- @include type.type({{size.code}});
- |
- - {{size.note}} - | -