Skip to content

refactor: variables for transparent-hovered/-pressed #4565

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

Merged
merged 6 commits into from
Jul 21, 2025
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Check our migration docs for breaking changes:
6. [v0.6 ➡ v0.7](https://github.com/db-ux-design-system/core-web/blob/main/docs/migration/v0.6.x-to-v0.7.x.md)
7. [v0.7 ➡ v1.0](https://github.com/db-ux-design-system/core-web/blob/main/docs/migration/v0.7.x-to-v1.0.0.md)
8. [v1.x ➡ v2.0](https://github.com/db-ux-design-system/core-web/blob/main/docs/migration/v1.x.x-to-v2.0.0.md)
9. [v2.x ➡ v3.0](https://github.com/db-ux-design-system/core-web/blob/main/docs/migration/v2.x.x-to-v3.0.0.md)

## FAQ

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion docs/migration/v2.x.x-to-v3.0.0.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
## Migration Beta (1.x.x) ➡ 2.0.0

## transparent-hovered/-pressed

We aligned some variables with design.

`db-adaptive-bg-basic-transparent-hovered` becomes:

- `db-adaptive-bg-basic-transparent-full-hovered`
- `db-adaptive-bg-basic-transparent-semi-hovered`

`db-adaptive-bg-basic-transparent-pressed` becomes:

- `db-adaptive-bg-basic-transparent-full-pressed`
- `db-adaptive-bg-basic-transparent-semi-pressed`

## db-button/DBButton type

### `type` property
Expand Down Expand Up @@ -51,7 +65,7 @@ We updated some breakpoints to align with design:

We renamed the `data-icon-after` and `data-icon-before` properties to `data-icon-trailing` and `data-icon-leading`,
as well the properties in components to `iconTrailing` and/or `iconLeading`.
Furthermore, we added the possibility to set a a trailing icon on the `db-button`/`DBButton` component.
Furthermore, we added the possibility to set a trailing icon on the `db-button`/`DBButton` component.

You can still use `db-icon`/`icon` in most elements/components, which results in showing the default icon.
Most of the time this will be the leading icon, but in some cases it might be the trailing icon, depending on the component.
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ Main use-case to overwrite a color or change colors by `data-variant`. Example:

.db-xxx {
@include helpers.hover {
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
}

@include helpers.active {
background-color: colors.$db-adaptive-bg-basic-transparent-pressed;
background-color: colors.$db-adaptive-bg-basic-transparent-full-pressed;
}

@each $name in colors.$variant-colors {
Expand Down
24 changes: 16 additions & 8 deletions packages/components/src/components/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@
// disable text-decoration if someone wants to use the button for an <a> tag
text-decoration: none;

@include helpers.hover {
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
}

@include helpers.active {
background-color: colors.$db-adaptive-bg-basic-transparent-pressed;
}

// Square icon only buttons
&[data-no-text="true"] {
@include icons.is-icon-text-replace();
Expand Down Expand Up @@ -92,10 +84,26 @@
&[data-variant=""],
&[data-variant="ghost"] {
background-color: colors.$db-adaptive-bg-basic-transparent-full-default;

@include helpers.hover {
background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
}

@include helpers.active {
background-color: colors.$db-adaptive-bg-basic-transparent-full-pressed;
}
}

&[data-variant="filled"] {
background-color: colors.$db-adaptive-bg-basic-transparent-semi-default;

@include helpers.hover {
background-color: colors.$db-adaptive-bg-basic-transparent-semi-hovered;
}

@include helpers.active {
background-color: colors.$db-adaptive-bg-basic-transparent-semi-pressed;
}
}

&:disabled {
Expand Down
20 changes: 10 additions & 10 deletions packages/components/src/components/checkbox/checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@

input {
&:not(:checked) {
--db-adaptive-bg-basic-transparent-default: var(
--db-#{$variant}-bg-basic-transparent-default
--db-adaptive-bg-basic-transparent-full-default: var(
--db-#{$variant}-bg-basic-transparent-full-default
);
--db-adaptive-bg-basic-transparent-hovered: var(
--db-#{$variant}-bg-basic-transparent-hovered
--db-adaptive-bg-basic-transparent-full-hovered: var(
--db-#{$variant}-bg-basic-transparent-full-hovered
);
--db-adaptive-bg-basic-transparent-pressed: var(
--db-#{$variant}-bg-basic-transparent-pressed
--db-adaptive-bg-basic-transparent-full-pressed: var(
--db-#{$variant}-bg-basic-transparent-full-pressed
);
}

Expand All @@ -64,10 +64,10 @@
--db-adaptive-bg-basic-transparent-full-default: var(
--db-#{$variant}-bg-inverted-contrast-high-default
);
--db-adaptive-bg-basic-transparent-hovered: var(
--db-adaptive-bg-basic-transparent-full-hovered: var(
--db-#{$variant}-bg-inverted-contrast-high-hovered
);
--db-adaptive-bg-basic-transparent-pressed: var(
--db-adaptive-bg-basic-transparent-full-pressed: var(
--db-#{$variant}-bg-inverted-contrast-high-pressed
);
}
Expand Down Expand Up @@ -106,10 +106,10 @@
--db-adaptive-bg-basic-transparent-full-default: var(
--db-adaptive-bg-inverted-contrast-max-default
);
--db-adaptive-bg-basic-transparent-hovered: var(
--db-adaptive-bg-basic-transparent-full-hovered: var(
--db-adaptive-bg-inverted-contrast-max-hovered
);
--db-adaptive-bg-basic-transparent-pressed: var(
--db-adaptive-bg-basic-transparent-full-pressed: var(
--db-adaptive-bg-inverted-contrast-max-pressed
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ db-custom-select-list-item:not(:last-of-type) {
&:has(> label) {
&:not(:has(input[type="radio"]:checked)) {
@include helpers.hover {
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
}

@include helpers.active {
background-color: colors.$db-adaptive-bg-basic-transparent-pressed;
background-color: colors.$db-adaptive-bg-basic-transparent-full-pressed;
}
}
}
Expand Down Expand Up @@ -71,8 +71,8 @@ db-custom-select-list-item:not(:last-of-type) {

> input {
// We revert interaction states for checkbox
--db-adaptive-bg-basic-transparent-hovered: #{colors.$db-adaptive-bg-basic-transparent-full-default};
--db-adaptive-bg-basic-transparent-pressed: #{colors.$db-adaptive-bg-basic-transparent-full-default};
--db-adaptive-bg-basic-transparent-full-hovered: #{colors.$db-adaptive-bg-basic-transparent-full-default};
--db-adaptive-bg-basic-transparent-full-pressed: #{colors.$db-adaptive-bg-basic-transparent-full-default};

&::after {
position: absolute;
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/input/input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ $icon-padding: calc(

&:hover,
&:focus {
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
}

&:active {
background-color: colors.$db-adaptive-bg-basic-transparent-pressed;
background-color: colors.$db-adaptive-bg-basic-transparent-full-pressed;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@
justify-content: space-between;

@include helpers.hover {
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
}

@include helpers.active {
background-color: colors.$db-adaptive-bg-basic-transparent-pressed;
background-color: colors.$db-adaptive-bg-basic-transparent-full-pressed;
}

&:has(~ .db-sub-navigation:is(:hover, :focus)) {
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
}
}

Expand Down
12 changes: 6 additions & 6 deletions packages/components/src/components/radio/radio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
--db-adaptive-on-bg-basic-emphasis-100-pressed: var(
--db-#{$variant}-on-bg-basic-emphasis-80-pressed
);
--db-adaptive-bg-basic-transparent-default: var(
--db-#{$variant}-bg-basic-transparent-default
--db-adaptive-bg-basic-transparent-full-default: var(
--db-#{$variant}-bg-basic-transparent-full-default
);
--db-adaptive-bg-basic-transparent-hovered: var(
--db-#{$variant}-bg-basic-transparent-hovered
--db-adaptive-bg-basic-transparent-full-hovered: var(
--db-#{$variant}-bg-basic-transparent-full-hovered
);
--db-adaptive-bg-basic-transparent-pressed: var(
--db-#{$variant}-bg-basic-transparent-pressed
--db-adaptive-bg-basic-transparent-full-pressed: var(
--db-#{$variant}-bg-basic-transparent-full-pressed
);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/tab-item/tab-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $with-icon-padding-calc: calc(

@include helpers.hover {
&:has(:not(input:disabled)) {
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
}

&:has(input:disabled) {
Expand All @@ -44,7 +44,7 @@ $with-icon-padding-calc: calc(

@include helpers.hover {
&:has(:not(input:disabled)) {
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
}

&:has(input:disabled) {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/textarea/textarea.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

&:has(textarea:not(:disabled):is(:hover, :focus)) {
&::after {
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
background-color: colors.$db-adaptive-bg-basic-transparent-semi-hovered;
}
}
}
Expand Down
18 changes: 12 additions & 6 deletions packages/components/src/styles/internal/_form-components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,17 @@ $db-min-inline-size: var(
--db-adaptive-bg-basic-transparent-semi-default: var(
--db-#{$variant}-bg-basic-transparent-semi-default
);
--db-adaptive-bg-basic-transparent-hovered: var(
--db-#{$variant}-bg-basic-transparent-hovered
--db-adaptive-bg-basic-transparent-full-hovered: var(
--db-#{$variant}-bg-basic-transparent-full-hovered
);
--db-adaptive-bg-basic-transparent-pressed: var(
--db-#{$variant}-bg-basic-transparent-pressed
--db-adaptive-bg-basic-transparent-full-pressed: var(
--db-#{$variant}-bg-basic-transparent-full-pressed
);
--db-adaptive-bg-basic-transparent-semi-hovered: var(
--db-#{$variant}-bg-basic-transparent-semi-hovered
);
--db-adaptive-bg-basic-transparent-semi-pressed: var(
--db-#{$variant}-bg-basic-transparent-semi-pressed
);
--db-adaptive-on-bg-basic-emphasis-100-default: var(
--db-#{$variant}-on-bg-basic-emphasis-100-default
Expand Down Expand Up @@ -363,7 +369,7 @@ $input-valid-types:
);

@include helpers.hover {
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
background-color: colors.$db-adaptive-bg-basic-transparent-semi-hovered;
}

&:is(input, textarea) {
Expand Down Expand Up @@ -485,7 +491,7 @@ $input-valid-types:
input {
cursor: helpers.$cursor-pointer;
background-color: var(
--db-adaptive-bg-basic-transparent-#{$variant}
--db-adaptive-bg-basic-transparent-full-#{$variant}
);
@content;
}
Expand Down
8 changes: 4 additions & 4 deletions packages/components/src/styles/internal/_scrollbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $scrollbar-width: helpers.px-to-rem(8);
&:is(:hover, :focus) {
&::-webkit-scrollbar-track,
&::-webkit-scrollbar-button:single-button {
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
}
}

Expand All @@ -45,7 +45,7 @@ $scrollbar-width: helpers.px-to-rem(8);
}

&::-webkit-scrollbar-thumb {
background-color: colors.$db-adaptive-bg-basic-transparent-pressed;
background-color: colors.$db-adaptive-bg-basic-transparent-full-pressed;
}

/* Buttons */
Expand All @@ -57,11 +57,11 @@ $scrollbar-width: helpers.px-to-rem(8);
block-size: form-components.$floating-label-size-calc;

&:is(:hover, :focus) {
background-color: colors.$db-adaptive-bg-basic-transparent-hovered;
background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
}

&:active {
background-color: colors.$db-adaptive-bg-basic-transparent-pressed;
background-color: colors.$db-adaptive-bg-basic-transparent-full-pressed;
}
}

Expand Down
Loading
Loading