diff --git a/.npmignore b/.npmignore index b9fe8d4..bb8d9c9 100644 --- a/.npmignore +++ b/.npmignore @@ -1,2 +1,3 @@ .github +.vscode *.css diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..b54787b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,12 @@ +{ + "workbench.colorCustomizations": { + // "activityBar.background" : "#507791", + // "activityBar.foreground" : "#f9f9f9", + "titleBar.activeBackground" : "#4f758e", + "titleBar.activeForeground" : "#f9f9f9", + "titleBar.inactiveBackground" : "#44657A", + "titleBar.inactiveForeground" : "#f9f9f9", + "statusBar.background" : "#4f758e", + "statusBar.foreground" : "#f9f9f9" + } +} diff --git a/.vscode/snippets.code-snippets b/.vscode/snippets.code-snippets new file mode 100644 index 0000000..36186be --- /dev/null +++ b/.vscode/snippets.code-snippets @@ -0,0 +1,10 @@ +{ + "CSS Variable Fallback": { + "description": "De-abstracts variables from their colloquial names into their programmatic goodness and provides a fallback to the CSS Variables.", + "scope": "scss", + "prefix": "v", + "body": [ + "@include v($1, $2);" + ] + } +} diff --git a/package.json b/package.json index 83d2f90..a8498c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@chrisburnell/bowhead", - "version": "0.1.8", + "version": "0.1.9", "description": "Memorable and maintainable design tokens in SCSS", "main": "bowhead.scss", "scripts": { @@ -21,6 +21,7 @@ "url": "https://github.com/chrisburnell/bowhead/issues" }, "keywords": [ + "design tokens", "scss" ] } diff --git a/src/_config.scss b/src/_config.scss index 09869d9..294e4a4 100644 --- a/src/_config.scss +++ b/src/_config.scss @@ -1,3 +1,7 @@ +// Decides whether or not use the CSS Variable or raw value when calling the +// @v function. +$bowhead-variable-as-default: true !default; + // Decides whether or not to show a fallback value for the CSS Variable. $bowhead-show-fallback: true !default; diff --git a/src/_functions.scss b/src/_functions.scss index 42ef65f..9f3b653 100644 --- a/src/_functions.scss +++ b/src/_functions.scss @@ -19,7 +19,7 @@ /// /// @return Associated CSS Variable or SCSS value /// -@function v($property, $value: default, $fallback: false) { +@function v($property, $value: default, $fallback: not $bowhead-variable-as-default) { $generic-values: auto, inherit, initial, none, revert, unset, 0, 1, 100%, currentColor; @if (index($generic-values, $value)) { @return $value; diff --git a/src/_mixins.scss b/src/_mixins.scss index 0b217db..7829c13 100644 --- a/src/_mixins.scss +++ b/src/_mixins.scss @@ -23,5 +23,5 @@ @if $show-fallback { #{$property}: v($property, $value, true); } - #{$property}: v($property, $value); + #{$property}: v($property, $value, false); }