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

style: update tabs tokens to pine #2060

Merged
merged 2 commits into from
Feb 13, 2025
Merged
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
40 changes: 20 additions & 20 deletions packages/sage-assets/lib/stylesheets/components/_tab.scss
Original file line number Diff line number Diff line change
@@ -20,16 +20,16 @@ $-tab-color-disabled: map-get($sage-tab-colors, disabled);
align-items: center;
overflow: hidden;
margin: 0;
padding: 0 0 sage-spacing(sm);
padding: 0 0 var(--pine-dimension-sm);
white-space: nowrap;
color: $-tab-color-default;
text-decoration: none;
transition: color map-get($sage-transitions, default), background-color map-get($sage-transitions, default), box-shadow map-get($sage-transitions, default);

.sage-tabs--filter & {
padding: rem(6px) rem(14px);
background-color: sage-color(grey, 200);
border-radius: sage-border(radius-x-large);
padding: calc(var(--pine-dimension-2xs) * 1.5) calc(var(--pine-dimension-xs) * 1.75); // 4px * 1.5 = 6px, 8px * 1.75 = 14px
Copy link
Contributor

Choose a reason for hiding this comment

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

I posed a question about this in Slack, but I am wondering if we'd like to continue using calcs this way. Would love to know your thoughts on it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thoughts in slack as well. For whatever reason there are values here that don't easily convert to dimensions. We can either hard code or calc so they scale or possibly extend dimensions a bit for simpler calculations. 🤷

background-color: var(--pine-color-background-container-disabled);
border-radius: calc(var(--pine-dimension-2xl) * 2.0833); // 48px * 2.0833 = 100px
@extend %t-sage-body-small-semi;

&::after {
@@ -42,7 +42,7 @@ $-tab-color-disabled: map-get($sage-tab-colors, disabled);
&:hover {
color: $-tab-color-active;
.sage-tabs--filter & {
background: sage-color(grey, 300);
background: var(--pine-color-border);
}
}

@@ -52,10 +52,10 @@ $-tab-color-disabled: map-get($sage-tab-colors, disabled);

&:focus-visible {
@include sage-focus-ring();
border-radius: sage-border(radius-small);
border-radius: var(--pine-dimension-2xs);

.sage-tabs--filter & {
border-radius: sage-border(radius-x-large);
border-radius: calc(var(--pine-dimension-2xl) * 2.0833); // 48px * 2.0833 = 100px
}

&::after {
@@ -67,8 +67,8 @@ $-tab-color-disabled: map-get($sage-tab-colors, disabled);
&.sage-tab--active {
color: $-tab-color-active;
.sage-tabs--filter & {
color: sage-color(white);
background: sage-color(grey, 900);
color: var(--pine-color-background-container);
background: var(--pine-color-primary);
&::after {
display: none;
}
@@ -89,22 +89,22 @@ $-tab-color-disabled: map-get($sage-tab-colors, disabled);
@include sage-tab-underline;

.sage-tabs--with-background & {
padding: sage-spacing(xs) sage-spacing(sm) sage-spacing(md);
border-start-start-radius: sage-border(radius-large);
border-start-end-radius: sage-border(radius-large);
padding: var(--pine-dimension-xs) var(--pine-dimension-sm) var(--pine-dimension-md);
border-start-start-radius: var(--pine-dimension-sm);
border-start-end-radius: var(--pine-dimension-sm);
background-clip: padding-box;

@extend %t-sage-body-xsmall-med;

&::after {
left: sage-spacing(sm);
right: sage-spacing(sm);
bottom: sage-spacing(sm);
left: var(--pine-dimension-sm);
right: var(--pine-dimension-sm);
bottom: var(--pine-dimension-sm);
opacity: 0;
}

&:focus-visible {
border-radius: sage-border(radius-small);
border-radius: var(--pine-dimension-2xs);
}

&:focus-visible::after,
@@ -115,25 +115,25 @@ $-tab-color-disabled: map-get($sage-tab-colors, disabled);

.sage-tabs--progressbar & {
overflow: visible;
gap: sage-grid-gap-options(sm);
gap: var(--pine-dimension-sm);

&:not(:last-child) {
&::before {
order: 2;
color: sage-color(grey, 600);
color: var(--pine-color-neutral-hover);

@include sage-icon-base(right-small, xl, pine);
}
}
}

.sage-tabs--with-background &.sage-tab--active {
background-color: sage-color(white);
background-color: var(--pine-color-background-container);
border-end-end-radius: 0;
border-end-start-radius: 0;

&:focus-visible {
border-radius: sage-border(radius-small);
border-radius: var(--pine-dimension-2xs);
}
}
}
14 changes: 7 additions & 7 deletions packages/sage-assets/lib/stylesheets/components/_tabs.scss
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
flex-direction: column;

@media (max-width: sage-breakpoint(sm-max)) {
margin-block-end: sage-spacing(sm);
margin-block-end: var(--pine-dimension-sm);
}

@media (min-width: sage-breakpoint(md-min)) {
@@ -35,10 +35,10 @@
}

.sage-tabs--with-background {
padding-block-start: sage-spacing(sm);
padding-inline-start: sage-spacing(xs);
padding-inline-end: sage-spacing(xs);
background-color: sage-color(grey, 200);
padding-block-start: var(--pine-dimension-sm);
padding-inline-start: var(--pine-dimension-xs);
padding-inline-end: var(--pine-dimension-xs);
background-color: var(--pine-color-border);
}

.sage-tabs--layout-stacked {
@@ -52,7 +52,7 @@
.sage-tabs-divider,
.sage-tabs-container > hr {
margin: 0;
border-block-start: 1px solid sage-color(grey, 300);
border-block-start: var(--pine-border);
}

.sage-tabs-pane {
@@ -81,6 +81,6 @@
position: relative;

.sage-tab--active {
background-color: sage-color(white);
background-color: var(--pine-color-background-container);
}
}