Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve color function #294

Merged
merged 2 commits into from
Feb 10, 2024
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
541 changes: 0 additions & 541 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.3.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.1.0.cjs

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
nodeLinker: node-modules
compressionLevel: mixed

enableGlobalCache: false

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.6.3.cjs
yarnPath: .yarn/releases/yarn-4.1.0.cjs
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
"css-loader": "^6.10.0",
"esbuild-loader": "^4.0.3",
"mini-css-extract-plugin": "^2.8.0",
"postcss": "^8.4.33",
"postcss": "^8.4.35",
"postcss-loader": "^8.1.0",
"postcss-scss": "^4.0.9",
"prettier": "^3.2.4",
"prettier": "^3.2.5",
"sass": "^1.70.0",
"sass-loader": "^14.1.0",
"style-dictionary": "^3.9.2",
"stylelint": "^16.2.1",
"stylelint-config-recess-order": "^4.4.0",
"stylelint-config-recess-order": "^4.6.0",
"stylelint-config-standard-scss": "^13.0.0",
"stylelint-declaration-strict-value": "^1.10.4",
"stylelint-order": "^6.0.4",
"stylelint-webpack-plugin": "^5.0.0",
"webpack": "^5.90.0",
"webpack": "^5.90.1",
"webpack-cli": "^5.1.4"
},
"packageManager": "yarn@3.6.3"
"packageManager": "yarn@4.1.0"
}
11 changes: 7 additions & 4 deletions src/css/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@
/// @arg {String} $id
/// @arg {List} $ids
@function color($id, $ids...) {
@if not map.has-key(token(color), $id, $ids...) {
@error "Invalid color.";
$value: map.get(token(color), $id, $ids...);
$list: list.join(($id), $ids);
$identifier: join-with-dashes($list);

@if not $value or meta.type-of($value) == "map" {
@error "Invalid color: #{$identifier}";
}

$list: list.join(($id), $ids);
@return var(--color-#{join-with-dashes($list)});
@return var(--color-#{$identifier});
}

/// Returns the font family with the given ID by referencing a custom property.
Expand Down
Loading