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

[Darkside] Quality assurance P7 #3530

Merged
merged 14 commits into from
Feb 4, 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
3 changes: 2 additions & 1 deletion @navikt/core/css/darkside/baseline/baseline.darkside.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ body,

/* ---------------------------- Inline utilities ---------------------------- */
[hidden] {
display: none !important;
/* CSS-layers reverses "!important" ordering, so we can't set this to important if we want to override it later. */
display: none;
}

/* https://web.dev/prefers-reduced-motion/ */
Expand Down
16 changes: 4 additions & 12 deletions @navikt/core/css/darkside/button.darkside.css
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,7 @@
}

&:active {
--__axc-button-border-color: transparent;

background-color: var(--ax-bg-accent-strong-pressed);
color: var(--ax-text-accent-contrast);
background-color: var(--ax-bg-accent-moderate-pressedA);
}

&:is(:disabled, .navds-button--disabled) {
Expand All @@ -173,10 +170,7 @@
}

&:active {
--__axc-button-border-color: transparent;

color: var(--ax-text-contrast);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like so many changes, I'm guessing they are fine? (i don't seem to find any differences so far tabbing between this chromatic & a local one from main).

Here it seems active state is weaker on already weaker surfaces, and probably the intent right? 💭 (it makes sense to me to not have to jump to super high contrast for the active state if the current is very low contrast)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are only affecting :active-state, so that we no longer "flip" the color, but rather keep it on moderate for active-state

background-color: var(--ax-bg-strong-pressed);
background-color: var(--ax-bg-moderate-pressedA);
}

&:is(:disabled, .navds-button--disabled) {
Expand All @@ -199,8 +193,7 @@
}

&:active {
background-color: var(--ax-bg-accent-strong-pressed);
color: var(--ax-text-accent-contrast);
background-color: var(--ax-bg-accent-moderate-pressedA);
}

&:is(:disabled, .navds-button--disabled) {
Expand All @@ -221,8 +214,7 @@
}

&:active {
background-color: var(--ax-bg-strong-pressed);
color: var(--ax-text-contrast);
background-color: var(--ax-bg-moderate-pressedA);
}

&:is(:disabled, .navds-button--disabled) {
Expand Down
135 changes: 1 addition & 134 deletions @navikt/core/css/darkside/copybutton.darkside.css
Original file line number Diff line number Diff line change
@@ -1,108 +1,4 @@
.navds-copybutton {
--__axc-copybutton-padding: var(--ax-space-12) var(--ax-space-20) var(--ax-space-12) var(--ax-space-16);

cursor: pointer;
margin: 0;
text-decoration: none;
border: none;
border-radius: var(--ax-border-radius-large);
padding: var(--__axc-copybutton-padding);
display: grid;
place-content: center;
background-color: transparent;
transition: color 0.2s cubic-bezier(0.05, 0.7, 0.1, 1);

&.navds-copybutton--icon-only {
--__axc-copybutton-padding: var(--ax-space-12);
}

&.navds-copybutton--icon-right {
--__axc-copybutton-padding: var(--ax-space-12) var(--ax-space-16) var(--ax-space-12) var(--ax-space-20);
}

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

&:focus-visible {
outline: 3px solid var(--ax-border-focus);
outline-offset: 3px;
}

&:disabled {
cursor: not-allowed;
opacity: var(--ax-opacity-disabled);
}

&:disabled:hover {
background-color: transparent;
}
}

@media (forced-colors: active) {
.navds-copybutton {
background-color: ButtonFace;
border: solid 1px ButtonText;
color: ButtonText;

&:disabled {
opacity: 1;
border-color: GrayText;
}
}
}

/* -------------------------- CopyButton small size ------------------------- */
.navds-copybutton--small {
min-height: 2rem;
min-width: 2rem;

--__axc-copybutton-padding: var(--ax-space-4) var(--ax-space-12) var(--ax-space-4) var(--ax-space-8);

&.navds-copybutton--icon-right {
--__axc-copybutton-padding: var(--ax-space-4) var(--ax-space-8) var(--ax-space-4) var(--ax-space-12);
}

&.navds-copybutton--icon-only {
--__axc-copybutton-padding: var(--ax-space-4);
}

& > .navds-copybutton__content {
gap: var(--ax-space-4);
}
}

/* ------------------------- CopyButton xsmall size ------------------------- */
.navds-copybutton--xsmall {
min-height: 1.5rem;
min-width: 1.5rem;

--__axc-copybutton-padding: var(--ax-space-2) var(--ax-space-8) var(--ax-space-2) var(--ax-space-4);

&.navds-copybutton--icon-right {
--__axc-copybutton-padding: var(--ax-space-2) var(--ax-space-4) var(--ax-space-2) var(--ax-space-8);
}

&.navds-copybutton--icon-only {
--__axc-copybutton-padding: var(--ax-space-2);
}

& .navds-copybutton__icon {
font-size: 1.25rem;
}

& > .navds-copybutton__content {
gap: var(--ax-space-2);
}
}

/* ----------------------------- CopyButton Icon ---------------------------- */
.navds-copybutton__icon {
font-size: 1.5rem;
display: flex;
}

.navds-copybutton--active .navds-copybutton__icon {
.navds-copybutton[data-active="true"] .navds-copybutton__icon {
animation: akselCopyButtonIconAnimation 2s cubic-bezier(0.05, 0.7, 0.1, 1);
}

Expand All @@ -123,32 +19,3 @@
transform: translateY(0);
}
}

/* ---------------------------- CopyButton Action --------------------------- */
.navds-copybutton--action {
color: var(--ax-text-accent);

&.navds-copybutton--active {
color: var(--ax-text-success);
}

&:disabled {
color: var(--ax-text-accent);
}
}

/* --------------------------- CopyButton Neutral --------------------------- */
.navds-copybutton--neutral {
color: var(--ax-text-subtle);

&:disabled {
color: var(--ax-text-subtle);
}
}

.navds-copybutton__content {
display: inline-flex;
align-items: center;
justify-content: center;
gap: var(--ax-space-6);
}
40 changes: 19 additions & 21 deletions @navikt/core/css/darkside/form/form-progress.darkside.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,35 @@

.navds-form-progress__collapsible {
display: grid;
grid-template-rows: 0fr;
visibility: hidden;
overflow: hidden;
transition: grid-template-rows 250ms cubic-bezier(0.2, 0, 0, 1);
border: 1px solid var(--ax-border-subtleA);
border-radius: var(--ax-border-radius-xlarge);
background: var(--ax-bg-raised);
padding-inline: var(--ax-space-20);
padding-block: 0;
opacity: 0.001;
transition-duration: 1s;
transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
transition-property: margin-top, opacity, visibility, padding-block-start, grid-template-rows;
grid-template-rows: 0fr;

/* border-block leaves 2px of space when closes, so offset 2px with margin */
margin-top: -2px;

&[hidden] {
display: grid !important;
display: grid;
}

&[data-state="open"] {
margin-top: var(--ax-space-4);
grid-template-rows: 1fr;
visibility: visible;
padding-block: var(--ax-space-16);
opacity: 1;
}
}

.navds-form-progress__collapsible-content {
min-height: 0;
opacity: 0.01;
visibility: hidden;
transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
transition-duration: 250ms;
transition-property: opacity, visibility;
}

.navds-form-progress__collapsible[data-state="open"] .navds-form-progress__collapsible-content {
visibility: visible;
opacity: 1;
}

.navds-form-progress__stepper {
border: 1px solid var(--ax-border-subtle);
border-radius: var(--ax-border-radius-xlarge);
padding: var(--ax-space-16) var(--ax-space-20);
margin-top: var(--ax-space-4);
background: var(--ax-bg-raised);
}
8 changes: 4 additions & 4 deletions @navikt/core/css/darkside/form/form-summary.darkside.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@

.navds-form-summary__header {
background: var(--ax-bg-moderateA);
padding: var(--ax-space-16) var(--ax-space-24);
padding: var(--ax-space-20) var(--ax-space-20) var(--ax-space-16) var(--ax-space-20);
display: flex;
justify-content: space-between;
gap: 0 var(--ax-space-12);
}

@media (max-width: 479px) {
.navds-form-summary__header {
padding: var(--ax-space-12) var(--ax-space-16);
padding: var(--ax-space-16) var(--ax-space-16) var(--ax-space-12) var(--ax-space-16);
flex-direction: column;
}
}
Expand All @@ -31,13 +31,13 @@
}

.navds-form-summary__answers {
padding: var(--ax-space-16) var(--ax-space-20);
padding: var(--ax-space-16) var(--ax-space-20) var(--ax-space-20) var(--ax-space-20);
margin: 0;
}

@media (max-width: 479px) {
.navds-form-summary__answers {
padding: var(--ax-space-16);
padding: var(--ax-space-12) var(--ax-space-16) var(--ax-space-16) var(--ax-space-16);
}
}

Expand Down
14 changes: 1 addition & 13 deletions @navikt/core/css/darkside/stepper.darkside.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,13 @@
}
}

&:hover {
& .navds-stepper__circle {
color: var(--ax-text-accent-strong);
}
}

& .navds-stepper__circle {
color: var(--ax-text-accent);
border-color: var(--ax-border-accent-strong);
}

&[data-active="true"] {
& .navds-stepper__content {
color: var(--ax-text-accent-strong);
text-decoration: none;
}

Expand All @@ -160,19 +153,14 @@
}

.navds-stepper__step[data-interactive="false"] {
color: var(--ax-text-default);
color: var(--ax-text-subtle);
cursor: default;

& .navds-stepper__circle {
color: var(--ax-text-default);
border-color: var(--ax-border-strong);
}

&[data-active="true"] {
& .navds-stepper__content {
color: var(--ax-text-subtle);
}

& .navds-stepper__circle {
color: var(--ax-text-contrast);
background-color: var(--ax-bg-strong-pressed);
Expand Down
Loading
Loading