Skip to content

Commit

Permalink
feat(globals): update global scssto new color tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
tw15egan committed Apr 14, 2021
1 parent eb6fd75 commit 8c06edd
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
tbody
tr:not(.#{$prefix}--parent-row):nth-child(even)
td {
// V11: Question for design: This currently maps to $ui-02
background-color: $data-table-zebra-color;
border-top: 1px solid $data-table-zebra-color;
border-bottom: 1px solid $data-table-zebra-color;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@

.#{$prefix}--data-table--zebra tbody tr[data-parent-row]:nth-child(4n + 1) td,
.#{$prefix}--data-table--zebra tbody tr[data-child-row]:nth-child(4n + 2) td {
// V11: Question for design: This currently maps to $ui-02
background-color: $data-table-zebra-color;
border-top: 1px solid $data-table-zebra-color;
border-bottom: 1px solid $data-table-zebra-color;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/toggle/_toggle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@
// Disabled
// ---------------------------------------------
.#{$prefix}--toggle-input:disabled + .#{$prefix}--toggle-input__label {
color: $disabled;
color: $text-disabled;
cursor: not-allowed;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/globals/scss/_css--body.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
@include reset;
@include type-style('body-short-01');

color: $text-01;
color: $text-primary;
line-height: 1;
background-color: $ui-background;
background-color: $background;
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/globals/scss/_css--helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
@include reset;
@include type-style('body-short-01');

color: $text-01;
color: $text-primary;
line-height: 1;
background-color: $ui-background;
background-color: $background;
}
}

Expand Down
8 changes: 4 additions & 4 deletions packages/components/src/globals/scss/_helper-mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
/// @example @include placeholder-colors;
/// @group global-helpers
@mixin placeholder-colors {
color: $text-05;
color: $text-placeholder;
opacity: 1;
}

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

@if ($type == 'invalid') {
outline: 2px solid $support-01;
outline: 2px solid $support-error;
outline-offset: -2px;

@media screen and (prefers-contrast) {
Expand Down Expand Up @@ -170,7 +170,7 @@
@mixin skeleton {
position: relative;
padding: 0;
background: $skeleton-01;
background: $skeleton-background;
border: none;
box-shadow: none;
pointer-events: none;
Expand All @@ -187,7 +187,7 @@
position: absolute;
width: 100%;
height: 100%;
background: $skeleton-02;
background: $skeleton-element;
animation: 3000ms ease-in-out skeleton infinite;
content: '';
will-change: transform-origin, transform, opacity;
Expand Down
38 changes: 20 additions & 18 deletions packages/components/src/globals/scss/_theme-tokens.scss
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ $input-label-weight: 400 !default;
/// @type Color
/// @access public
/// @group global-themes
$disabled: $disabled-02 !default;
$disabled: $text-disabled !default;

/// @type Color
/// @access public
/// @group global-themes
/// @deprecated
$disabled-background-color: $disabled-01 !default;
$disabled-background-color: $layer-disabled !default;

/// @type Color
/// @access public
Expand Down Expand Up @@ -160,7 +160,7 @@ $link-inverse-color: #6ea6ff !default;
/// @type Color
/// @access public
/// @group tooltip
$tooltip-background-color: $inverse-02 !default;
$tooltip-background-color: $background-inverse !default;

// Button

Expand Down Expand Up @@ -284,13 +284,13 @@ $checkbox-border-width: 2px !default;
/// @access public
/// @group code-snippet
/// @deprecated
$snippet-background-color: $field-01 !default;
$snippet-background-color: $field !default;

/// @type Color
/// @access public
/// @group code-snippet
/// TODO: Define for experimental
$snippet-border-color: $ui-03 !default;
$snippet-border-color: $border-subtle !default;

// Content Switcher

Expand All @@ -302,12 +302,12 @@ $content-switcher-border-radius: 0 !default;
/// @type Number
/// @access public
/// @group content-switcher
$content-switcher-option-border: 1px solid $brand-01 !default;
$content-switcher-option-border: 1px solid $border-interactive !default;

/// @type Color
/// @access public
/// @group content-switcher
$content-switcher-divider: $ui-03 !default;
$content-switcher-divider: $border-subtle !default;

// Data Table

Expand All @@ -319,7 +319,7 @@ $data-table-heading-transform: uppercase !default;
/// @type Value
/// @access public
/// @group data-table
$data-table-heading-border-bottom: 1px solid $brand-01 !default;
$data-table-heading-border-bottom: 1px solid $border-interactive !default;

/// @type Number
/// @access public
Expand All @@ -329,12 +329,13 @@ $data-table-row-height: 2rem !default;
/// @type Color
/// @access public
/// @group data-table
// V11: We need a token for zebra styles
$data-table-zebra-color: $ui-02 !default;

/// @type Color
/// @access public
/// @group data-table
$data-table-column-hover: $hover-selected-ui !default;
$data-table-column-hover: $layer-selected-hover !default;

// Date Picker

Expand All @@ -349,13 +350,13 @@ $date-picker-in-range-background-color: $ibm-color__blue-20 !default;
/// @type Color
/// @access public
/// @group modal
$modal-border-top: $brand-01 4px solid !default;
$modal-border-top: 4px solid $border-interactive !default;

/// @type Color
/// @access public
/// @group modal
/// @deprecated
$modal-footer-background-color: $ui-03 !default;
$modal-footer-background-color: $layer-accent !default;

// Notification

Expand Down Expand Up @@ -409,12 +410,12 @@ $progress-indicator-line-offset: 0.625rem !default;
/// @type Color
/// @access public
/// @group copy-button
$copy-active: $active-ui !default;
$copy-active: $layer-active !default;

/// @type Color
/// @access public
/// @group copy-button
$copy-btn-feedback: $inverse-02 !default;
$copy-btn-feedback: $background-inverse !default;

// Radio Button

Expand All @@ -440,30 +441,30 @@ $structured-list-text-transform: none !default;
/// @type Value
/// @access public
/// @group tabs
$tab-underline-color: 2px solid $ui-03 !default;
$tab-underline-color: 2px solid $border-subtle !default;

/// @type Value
/// @access public
/// @group tabs
$tab-underline-color-hover: 2px solid $ui-04 !default;
$tab-underline-color-hover: 2px solid $border-strong !default;

/// @type Color
/// @access public
/// @group tabs
$tab-text-disabled: $disabled-02 !default;
$tab-text-disabled: $text-disabled !default;

/// @type Value
/// @access public
/// @group tabs
$tab-underline-disabled: 2px solid $disabled-01 !default;
$tab-underline-disabled: 2px solid $border-disabled !default;

// Skeleton Loading

/// @type Color
/// @access public
/// @group skeleton
/// TODO: Remove this in next major release
$skeleton: $skeleton-01 !default;
$skeleton: $skeleton-background !default;

// Light UI

Expand Down Expand Up @@ -501,4 +502,5 @@ $skeleton: $skeleton-01 !default;
/// @type Color
/// @access public
/// @group light-ui
// V11: No longer needed
$hover-ui-light: get-light-value('ui-01');
12 changes: 6 additions & 6 deletions packages/components/src/globals/scss/_tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
rem(8px) rem(16px),
rem(3px) rem(16px)
);
color: $inverse-01;
color: $text-inverse;
font-weight: 400;
text-align: left;
background-color: $inverse-02;
background-color: $background-inverse;
border-radius: rem(2px);
transform: translateX(-50%);
@include type-style('body-short-01');
Expand Down Expand Up @@ -284,25 +284,25 @@
&::before {
@if ($position == 'top') {
top: -$caret-spacing;
border-color: $inverse-02 transparent transparent transparent;
border-color: $background-inverse transparent transparent transparent;
border-width: rem(5px) rem(4px) 0 rem(4px);
transform: translate(-50%, -100%);
}
@if ($position == 'right') {
right: -$caret-spacing;
border-color: transparent $inverse-02 transparent transparent;
border-color: transparent $background-inverse transparent transparent;
border-width: rem(4px) rem(5px) rem(4px) 0;
transform: translate(100%, -50%);
}
@if ($position == 'bottom') {
bottom: -$caret-spacing;
border-color: transparent transparent $inverse-02 transparent;
border-color: transparent transparent $background-inverse transparent;
border-width: 0 rem(4px) rem(5px) rem(4px);
transform: translate(-50%, 100%);
}
@if ($position == 'left') {
left: -$caret-spacing;
border-color: transparent transparent transparent $inverse-02;
border-color: transparent transparent transparent $background-inverse;
border-width: rem(4px) 0 rem(4px) rem(5px);
transform: translate(-100%, -50%);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const props = () => ({
});

export default {
title: 'Components/Skeleton/SkeletonPlaceholder',
title: 'Components/Skeleton',
decorators: [withKnobs],

parameters: {
Expand All @@ -35,7 +35,7 @@ export default {
},
};

export const Default = () => (
export const _SkeletonPlaceholder = () => (
<div style={{ height: '250px', width: '250px' }}>
<style
dangerouslySetInnerHTML={{
Expand All @@ -60,15 +60,3 @@ export const Default = () => (
<SkeletonPlaceholder {...props()} />
</div>
);

Default.parameters = {
info: {
text: `
Skeleton states are used as a progressive loading state while the user waits for content to load.
By taking a height and/or width property, this component can be used when you know the exact dimensions of the incoming content, such as an image.
However, for performance reasons, it's recommended to create a class in your stylesheet to set the dimensions.
`,
},
};
12 changes: 2 additions & 10 deletions packages/react/src/components/SkeletonText/SkeletonText-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const props = () => ({
});

export default {
title: 'Components/Skeleton/SkeletonText',
title: 'Components/Skeleton',
decorators: [withKnobs],

parameters: {
Expand All @@ -41,16 +41,8 @@ export default {
},
};

export const Default = () => (
export const _SkeletonText = () => (
<div style={{ width: '300px' }}>
<SkeletonText {...props()} />
</div>
);

Default.parameters = {
info: {
text: `
Skeleton states are used as a progressive loading state while the user waits for content to load.
`,
},
};

0 comments on commit 8c06edd

Please sign in to comment.