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(Anchor): remove horizontal padding #2365

Merged
merged 3 commits into from
May 23, 2023
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
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.
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.
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.
tujoworker marked this conversation as resolved.
Show resolved Hide resolved
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.
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.
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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// make sure we have always `display: inline;` as inline-block is breaking the border-bottom
display: inline;

padding: 0.05575em 0.125em; // the total body height will then be 24px if font-size is 18px
padding: 0.05575em 0; // the total body height will then be 24px if font-size is 18px

font-size: var(--font-size-basis);
text-decoration: underline;
Expand Down Expand Up @@ -107,6 +107,11 @@
border-radius: 0.25em;
}

@mixin anchorBackground($color) {
box-shadow: inset 100vw 100vw 0 0 $color, -0.125rem 0 0 0 $color,
0.125rem 0 0 0 $color;
}

// other styles
@mixin useAnchorContrastStyle($contrastColor: var(--color-emerald-green)) {
color: var(--color-white);
Expand Down Expand Up @@ -197,8 +202,7 @@
}
}

transition: background-color 200ms ease-in-out,
border-radius 200ms ease-in-out;
transition: box-shadow 200ms ease-in-out, border-radius 200ms ease-in-out;

[data-visual-test-wrapper] & {
transition: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
&:hover,
&:active {
color: var(--color-sea-green);
background-color: var(--color-mint-green-50);
@include anchor-mixins.anchorBackground(var(--color-mint-green-50));
}

&:active {
color: var(--color-mint-green);
background-color: var(--color-emerald-green);
@include anchor-mixins.anchorBackground(var(--color-emerald-green));
}

&:focus {
Expand All @@ -23,12 +23,12 @@

.dnb-anchor--hover {
color: var(--color-sea-green);
background-color: var(--color-mint-green-50);
@include anchor-mixins.anchorBackground(var(--color-mint-green-50));
}

.dnb-anchor--active {
color: var(--color-mint-green);
background-color: var(--color-emerald-green);
@include anchor-mixins.anchorBackground(var(--color-emerald-green));
}

.dnb-anchor--focus {
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.
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.