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

feat(packages/sui-theme): get closer to native css #1804

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 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
348 changes: 185 additions & 163 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/sui-component-dependencies/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@s-ui/component-dependencies",
"version": "1.7.0",
"version": "1.7.0-beta.0",
"description": "A set of dependencies of all SUI components.",
"keywords": [
"fatigue",
Expand All @@ -9,7 +9,7 @@
"author": "",
"license": "MIT",
"dependencies": {
"@s-ui/theme": "8",
"@s-ui/theme": "beta",
"classnames": "2.2.5"
},
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/sui-react-web-vitals/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@s-ui/react-web-vitals",
"version": "2.6.0",
"version": "2.6.0-beta.0",
"description": "",
"type": "module",
"main": "lib/index.js",
Expand All @@ -18,7 +18,7 @@
"license": "MIT",
"dependencies": {
"web-vitals": "4.1.1",
"@s-ui/react-hooks": "1"
"@s-ui/react-hooks": "beta"
},
"peerDependencies": {
"react": "16 || 17",
Expand Down
2 changes: 1 addition & 1 deletion packages/sui-svg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"sui-svg": "./bin/sui-svg.js"
},
"dependencies": {
"@s-ui/react-atom-icon": "1",
"@s-ui/react-atom-icon": "beta",
"babel-preset-sui": "3",
"commander": "8.3.0",
"fast-glob": "3.2.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/sui-theme/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@s-ui/theme",
"version": "8.127.0",
"version": "9.0.0-beta.1",
"description": "Generic theme to add styles to all SUI components",
"main": "lib/index.scss",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/sui-theme/src/components/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@
color: $color;

&:hover {
background-color: lighten($background-color, 15%);
background-color: color-mix(in srgb, $background-color, $color-variation-light 10%);
}

&:active {
background-color: darken($background-color, 10%);
background-color: color-mix(in srgb, $background-color, $color-variation-dark 10%);
}

& > [class$='icon'],
Expand Down
12 changes: 8 additions & 4 deletions packages/sui-theme/src/utils/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@ $color-darken-steps: 20, 35, 55, 75 !default;
$variation: $color;

@if ($step > $positive-steps) {
$variation: mix($light, $color, nth($color-lighten-steps, $positive-steps));
$variation: color-mix(in srgb, $color-variation-light #{'#{nth($color-lighten-steps, $positive-steps)}%'}, $color);
} @else if ($step < -$negative-steps) {
$variation: mix($dark, $color, nth($color-darken-steps, $negative-steps));
$variation: color-mix(in srgb, $color-variation-dark #{'#{nth($color-darken-steps, $negative-steps)}%'}, $color);
} @else if ($step < 0) {
$variation: mix($dark, $color, nth($color-darken-steps, -$step));
$variation: color-mix(in srgb, $color-variation-dark #{'#{nth($color-darken-steps, -$step)}%'}, $color);
} @else if ($step > 0) {
$variation: mix($light, $color, nth($color-lighten-steps, $step));
$variation: color-mix(in srgb, $color-variation-light #{'#{nth($color-lighten-steps, $step)}%'}, $color);
}

@return $variation;
}

@function transparentize($color, $amount) {
@return color-mix(in srgb, $color #{'#{(1 - $amount) * 100}%'}, transparent);
}
6 changes: 3 additions & 3 deletions packages/sui-theme/src/utils/_opacity.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
// @include bgcolor-opacity($c-black);

@mixin bgcolor-opacity($color) {
background-color: rgba($color, 1);
background-color: color-mix(in srgb, $color 100%, transparent);

@each $value in $c-opacity {
&-#{$value} {
background-color: rgba($color, $value * 0.01);
background-color: color-mix(in srgb, $color #{'#{$value}%'}, transparent);
}
}
}
Expand All @@ -19,7 +19,7 @@
position: relative;

&::before {
background-color: rgba($color, $value * 0.01);
background-color: color-mix(in srgb, $color #{'#{$value}%'}, transparent);
content: '';
display: block;
height: 100%;
Expand Down
2 changes: 1 addition & 1 deletion packages/sui-widget-embedder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@s-ui/bundler": "9",
"@s-ui/helpers": "1",
"@s-ui/react-context": "1",
"@s-ui/react-hooks": "1",
"@s-ui/react-hooks": "1.38.0-beta.0",
andresin87 marked this conversation as resolved.
Show resolved Hide resolved
"commander": "8.3.0",
"copy-paste": "1.3.0",
"webpack-dev-middleware": "5.3.4"
Expand Down