Skip to content

Commit

Permalink
Fix issue where css-prop functuon expected only one hyphen
Browse files Browse the repository at this point in the history
  • Loading branch information
unofficialmatt committed Jan 21, 2024
1 parent 0639ed7 commit 0e8152e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/css/jellyfish.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/jellyfish.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jellyfish-ui",
"version": "4.1.0",
"version": "4.2.0",
"author": {
"name": "Matt Weet",
"email": "hello@mattweet.com",
Expand Down
9 changes: 4 additions & 5 deletions src/scss/abstracts/01-tools/_functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,13 @@
$prop: str-replace($prop, "var(--color-", "");
$prop: str-replace($prop, ")", "");

// Work out where the hyphen is
$hyphen: str-index($prop, "-");
// Work out where the last hyphen is
$last-hyphen: str-index(str-reverse($prop), "-");

// Get the parts of the string
$base: str-slice($prop, 1, $hyphen - 1);
$end: str-slice($prop, $hyphen + 1);
$base: str-slice($prop, 1, -($last-hyphen + 1));
$end: str-slice($prop, -($last-hyphen - 1));

// Convert the end to a number
$end: str.to-number($end);

$color: get-color-raw($base, $end);
Expand Down

0 comments on commit 0e8152e

Please sign in to comment.