Skip to content

Commit

Permalink
design: Copybutton-icon is now 20px for small og xsmall sizes (#2977)
Browse files Browse the repository at this point in the history
* design: Copybutton-icon is now 20px for small og xsmall sizes

* bug: Replace aspect-ratio for min height/width with regular min-width and min-height attrb
  • Loading branch information
KenAJoh authored Jun 5, 2024
1 parent d0debc1 commit d5818a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/old-moose-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-css": patch
---

CopyButton: Icon is now 20px for size small and xsmall.
10 changes: 6 additions & 4 deletions @navikt/core/css/copybutton.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
--__ac-copybutton-padding: var(--a-spacing-1) var(--a-spacing-3) var(--a-spacing-1) var(--a-spacing-2);

min-height: 2rem;
min-width: 2rem;
}

.navds-copybutton--small.navds-copybutton--icon-right {
Expand All @@ -61,6 +62,7 @@
--__ac-copybutton-padding: var(--a-spacing-05) var(--a-spacing-2) var(--a-spacing-05) var(--a-spacing-1);

min-height: 1.5rem;
min-width: 1.5rem;
}

.navds-copybutton--xsmall.navds-copybutton--icon-right {
Expand All @@ -79,15 +81,15 @@
--__ac-copybutton-padding: var(--a-spacing-05);
}

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

.navds-copybutton__icon {
font-size: 1.5rem;
display: flex;
}

:where(.navds-copybutton--xsmall, .navds-copybutton--small) .navds-copybutton__icon {
font-size: 1.25rem;
}

.navds-copybutton__icon:first-of-type {
margin-left: -0.25rem;
}
Expand Down
6 changes: 3 additions & 3 deletions @navikt/core/react/src/copybutton/copy-button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import { Tooltip } from "../tooltip";
const meta: Meta<typeof CopyButton> = {
title: "ds-react/CopyButton",
component: CopyButton,
parameters: {
chromatic: { disable: true },
},
};
export default meta;

Expand All @@ -32,9 +35,6 @@ export const Default: Story = {
text: "",
activeText: "",
},
parameters: {
chromatic: { disable: true },
},
};

export const Interaction: Story = {
Expand Down

0 comments on commit d5818a5

Please sign in to comment.