Skip to content

Commit

Permalink
[Darkside] 🚚 -hover tokens are now soft-hover (#3553)
Browse files Browse the repository at this point in the history
* 💄 Update background Header

* 💄 Update popover padding for smaller screens

* 💄 Adjusted borders

* 💄 Uses Alpha-tokens for zebra-stripes in Table

* 💄 Stronger border for hovered timeline items, transparent track bg

* 💄 Transparent lines for Tabs to contrast colored bg

* 💄 New icons for Table-sorting

* 💄 Selected exoanded item now has accent colors

* 💄 Keeps border-color for active state in search-button

* 💄 Removed hover-color change on checked radio

* 💄 Only non-responsive or left-static guidepanels shrink on tablet or below

* 📝 Changeset

* 🚚 -hover tokens are now soft-hover

* 🚚 Referansesider uses new soft-hover token
  • Loading branch information
KenAJoh authored Feb 6, 2025
1 parent 70dd5b5 commit 281ac2d
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion @navikt/core/css/darkside/accordion.darkside.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}

&:hover {
background-color: var(--ax-bg-accent-hoverA);
background-color: var(--ax-bg-accent-soft-hoverA);

&::before,
&::after {
Expand Down
2 changes: 1 addition & 1 deletion @navikt/core/css/darkside/expansioncard.darkside.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
justify-content: space-between;

&:hover {
background-color: var(--ax-bg-hoverA);
background-color: var(--ax-bg-soft-hoverA);
}

&[data-open="true"] {
Expand Down
2 changes: 1 addition & 1 deletion @navikt/core/css/darkside/read-more.darkside.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
border-radius: var(--ax-border-radius-medium);

&:hover {
background-color: var(--ax-bg-hoverA);
background-color: var(--ax-bg-soft-hoverA);
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions @navikt/core/css/darkside/table.darkside.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
display: table-row-group;

& .navds-table__row--shade-on-hover:not(.navds-table__expandable-row--expansion-disabled):hover {
background-color: var(--ax-bg-hoverA);
background-color: var(--ax-bg-soft-hoverA);
transition: background-color 70ms cubic-bezier(0.2, 0, 0, 1);
}

& .navds-table__row--shade-on-hover.navds-table__row--selected:hover {
background-color: var(--ax-bg-accent-hoverA);
background-color: var(--ax-bg-accent-soft-hoverA);
}
}

Expand Down Expand Up @@ -131,7 +131,7 @@
}

.navds-table__sort-button:hover {
background-color: var(--ax-bg-hoverA);
background-color: var(--ax-bg-soft-hoverA);
}

.navds-table__sort-button:focus-visible {
Expand Down Expand Up @@ -211,7 +211,7 @@
.navds-table__toggle-expand-button:hover,
.navds-table__toggle-expand-cell:hover > .navds-table__toggle-expand-button,
.navds-table__expandable-row--clickable:hover .navds-table__toggle-expand-button {
background-color: var(--ax-bg-hoverA);
background-color: var(--ax-bg-soft-hoverA);
}

.navds-table__toggle-expand-cell--open > :where(.navds-table__toggle-expand-button) :where(.navds-table__expandable-icon) {
Expand Down
4 changes: 2 additions & 2 deletions @navikt/core/tokens/darkside/tokens/semantic-roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const configForRole = (role: SemanticColorRoles) => {
type: "color",
group: `background.${role}`,
},
[`${role}-hover`]: {
[`${role}-soft-hover`]: {
value: `{ax.${role}.200.value}`,
type: "color",
group: `background.${role}`,
},
[`${role}-hoverA`]: {
[`${role}-soft-hoverA`]: {
value: `{ax.${role}.200A.value}`,
type: "color",
group: `background.${role}`,
Expand Down
6 changes: 3 additions & 3 deletions @navikt/core/tokens/darkside/tokens/semantic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ export function semanticTokenConfig(theme: ColorTheme) {
type: "color",
group: `background`,
},
hover: {
"soft-hover": {
value: `{ax.neutral.200.value}`,
type: "color",
group: `background`,
},
hoverA: {
"soft-hoverA": {
value: `{ax.neutral.200A.value}`,
type: "color",
group: `background`,
Expand Down Expand Up @@ -156,7 +156,7 @@ export function semanticTokenConfig(theme: ColorTheme) {
group: "border",
},
strong: {
value: "{ax.neutral.600.value}",
value: "{ax.neutral.700.value}",
type: "color",
group: "border",
},
Expand Down
8 changes: 4 additions & 4 deletions @navikt/core/tokens/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export type StaticDefaultBgKeys =
| "strong";

export type StatefulDefaultBgKeys =
| "hover"
| "hoverA"
| "soft-hover"
| "soft-hoverA"
| "moderate-hover"
| "moderate-hoverA"
| "moderate-pressed"
Expand All @@ -73,8 +73,8 @@ export type StaticBgKeys =
| `${SemanticColorRoles}-strong`;

export type StatefulBgKeys =
| `${SemanticColorRoles}-hover`
| `${SemanticColorRoles}-hoverA`
| `${SemanticColorRoles}-soft-hover`
| `${SemanticColorRoles}-soft-hoverA`
| `${SemanticColorRoles}-moderate-hover`
| `${SemanticColorRoles}-moderate-hoverA`
| `${SemanticColorRoles}-moderate-pressed`
Expand Down
2 changes: 1 addition & 1 deletion examples/referansesider/src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const ScButton = styled.button`
box-shadow: inset 0 0 0 2px ${tokens.BorderAccent};
&:hover {
background-color: ${tokens.BgAccentHover};
background-color: ${tokens.BgAccentSoftHover};
}
&:active {
Expand Down
2 changes: 1 addition & 1 deletion examples/referansesider/src/routes/sykepenger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ let AccordionItem: ReactNode;
const ScSummary = styled.summary`
background-color: ${tokens.BgDefault};
&:hover {
background-color: ${tokens.BgAccentHover};
background-color: ${tokens.BgAccentSoftHover};
}
`;

Expand Down

0 comments on commit 281ac2d

Please sign in to comment.