Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quick-timers-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@showbie/backpack-tokens': minor
---

Add CSS custom property template
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
<code>{{ chromaColor.hex() }}</code>
</dd>
</div>
<div class="mv2 mh2">
<dt class="f7 fw6 lh-copy ttu">CSS</dt>
<dd class="f5 ml0">
<code>--{{ variablePrefix }}-{{ hue }}-{{ scale }}</code>
</dd>
</div>
<div class="mv2 mh2">
<dt class="f7 fw6 lh-copy ttu">SCSS</dt>
<dd class="f5 ml0">
Expand Down
6 changes: 6 additions & 0 deletions packages/backpack-tokens/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const DocsColors = new ColorDocsBuilder({
socrative: SOCRATIVE,
});

ShowbieColors.build('showbie-color.css', [
path.join(__dirname, '..', 'dist', 'showbie-color.css'),
]);
ShowbieColors.build('showbie-color.scss', [
path.join(__dirname, '..', 'dist', 'showbie-color.scss'),
]);
Expand All @@ -32,6 +35,9 @@ ShowbieColors.build('showbie-color.js', [
path.join(__dirname, '..', 'dist', 'showbie-color.js'),
]);

SocrativeColors.build('showbie-color.css', [
path.join(__dirname, '..', 'dist', 'socrative-color.css'),
]);
SocrativeColors.build('showbie-color.less', [
path.join(__dirname, '..', 'dist', 'socrative-color.less'),
]);
Expand Down
14 changes: 14 additions & 0 deletions packages/backpack-tokens/lib/templates/showbie-color.css.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* BACKPACK COLOURS
* v{{version}}
*/

:root {
{{#each colors as |hue|}}

/* {{capitalize hue.name}} */
{{#each hue.scale as |value label|}}
--{{hue.prefix}}-{{hue.name}}-{{label}}: {{value}};
{{/each}}
{{/each}}
}