Skip to content

Commit

Permalink
fix(vital-demo): Update styleguide color tokens (#2213)
Browse files Browse the repository at this point in the history
* Update color token on 'Border' styleguide page

* Enable proper rendering of disabled color token

* Fix text alignment on 'Color' styleguide page

* Add bg to BorderLightThemeBase styleguide entry

---------

Co-authored-by: Uladzislau Arlouski <uarlouski@gmail.com>
  • Loading branch information
samlynndavis and uarlouski committed Aug 24, 2023
1 parent 199151d commit c7cec79
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,7 @@ const BaseVariation = {
};

const BorderColorVariations = {
BorderLightThemeBase: vitalColor.BorderLightBase,
BorderInteractiveLightThemeIdle: vitalColor.BorderInteractiveLightIdle,
BorderInteractiveLightThemeDisabled: vitalColor.BorderInteractiveLightDisabled,
BorderInteractiveLightThemeFocus: 'border-kenvue-green-shade-80',
BorderInteractiveLightThemePressed: 'border-kenvue-green-shade-60',
BorderInteractiveLightThemeHover: 'border-kenvue-green-shade-80',
BorderDarkThemeBase: as(
BorderLightThemeBase: as(
withParent(Div),
withDesign({
Parent: as(
Expand All @@ -50,8 +44,14 @@ const BorderColorVariations = {
'flex justify-center items-center w-[150px]',
),
}),
vitalColor.BorderDarkBase,
vitalColor.BorderLightBase,
),
BorderInteractiveLightThemeIdle: vitalColor.BorderInteractiveLightIdle,
BorderInteractiveLightThemeDisabled: vitalColor.BorderInteractiveLightDisabled,
BorderInteractiveLightThemeFocus: 'border-kenvue-green-shade-80',
BorderInteractiveLightThemePressed: 'border-kenvue-green-shade-60',
BorderInteractiveLightThemeHover: 'border-kenvue-green-shade-80',
BorderDarkThemeBase: vitalColor.BorderDarkBase,
BorderInteractiveDarkThemeIdle: vitalColor.BorderInteractiveDarkIdle,
BorderInteractiveDarkThemeHover: 'border-kenvue-green-tint-60',
BorderInteractiveDarkThemeDisabled: vitalColor.BorderInteractiveDarkDisabled,
Expand Down Expand Up @@ -91,7 +91,7 @@ const vitalWidthVariations = varyDesigns(
BaseVariation,
BorderWidthVariations,
{
'': vitalColor.BorderLightBase
'': vitalColor.BorderDarkBase
}
);
const vitalRoundingVariations = varyDesigns(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import {
varyDesigns,
addProps,
as,
startWith,
Button,
} from '@bodiless/fclasses';
import { asFluidToken, vitalColor } from '@bodiless/vital-elements';
import { asStyleGuideTemplateToken, vitalStyleGuideTemplate } from '@bodiless/vital-templates';
Expand All @@ -36,41 +38,57 @@ const BaseColorVariation = {

const ColorVariations = {
BackgroundInteractiveLightThemeIdle: vitalColor.BackgroundInteractiveLightIdle,
BackgroundInteractiveLightThemeHover: 'bg-kenvue-green-shade-80',
BackgroundInteractiveLightThemeFocus: 'bg-kenvue-green-shade-80',
BackgroundInteractiveLightThemePressed: 'bg-kenvue-green-shade-60',
BackgroundInteractiveLightThemeDisabled: vitalColor.BackgroundInteractiveLightDisabled,
BackgroundInteractiveLightThemeHover: 'bg-kenvue-green-tint-60',
BackgroundInteractiveLightThemeFocus: 'bg-kenvue-green-tint-60',
BackgroundInteractiveLightThemePressed: 'bg-kenvue-green-tint-20',
BackgroundInteractiveLightThemeDisabled: as(
startWith(Button),
addProps({ disabled: true }),
vitalColor.BackgroundInteractiveLightDisabled,
),
BackgroundInteractiveDarkThemeIdle: vitalColor.BackgroundInteractiveDarkIdle,
BackgroundInteractiveDarkThemeHover: 'bg-kenvue-green-tint-60',
BackgroundInteractiveDarkThemeFocus: 'bg-kenvue-green-tint-60',
BackgroundInteractiveDarkThemePressed: 'bg-kenvue-green-tint-20',
BackgroundInteractiveDarkThemeDisabled: vitalColor.BackgroundInteractiveDarkDisabled,
BackgroundInteractiveDarkThemeHover: 'bg-kenvue-green-shade-80',
BackgroundInteractiveDarkThemeFocus: 'bg-kenvue-green-shade-80',
BackgroundInteractiveDarkThemePressed: 'bg-kenvue-green-shade-60',
BackgroundInteractiveDarkThemeDisabled: as(
startWith(Button),
addProps({ disabled: true }),
vitalColor.BackgroundInteractiveDarkDisabled,
),
};

const BaseTextVariation = {
'': on(Span)(
'w-[100px] h-[100px]',
'block',
'block flex',
'text-24.2px',
addProps({children: 'Text'}),
),
};

const TextVariations = {
TextInteractiveDarkThemeIdle: vitalColor.TextInteractiveDarkIdle,
TextInteractiveDarkThemeHover: 'text-kenvue-green-shade-80',
TextInteractiveDarkThemeFocus: 'text-kenvue-green-shade-80',
TextInteractiveDarkThemePressed: 'text-kenvue-green-shade-60',
TextInteractiveDarkThemeDisabled: as(
startWith(Button),
addProps({ disabled: 'true'}),
vitalColor.TextInteractiveDarkDisabled,
),
TextInteractiveLightThemeIdle: vitalColor.TextInteractiveLightIdle,
TextInteractiveDarkThemeHover: 'text-kenvue-green-tint-60',
TextInteractiveDarkThemeDisabled: vitalColor.TextInteractiveDarkDisabled,
TextInteractiveDarkThemePressed: 'text-kenvue-green-tint-20',
TextInteractiveDarkThemeFocus: 'text-kenvue-green-tint-60',
TextInteractiveLightThemeDisabled: vitalColor.TextInteractiveLightDisabled,
BorderInteractiveLightThemeFocus: 'text-kenvue-green-shade-80',
TextInteractiveLightThemeFocus: 'text-kenvue-green-shade-80',
TextInteractiveLightThemePressed: 'text-kenvue-green-shade-60',
TextInteractiveLightThemeHover: 'text-kenvue-green-tint-60',
TextInteractiveLightThemeFocus: 'text-kenvue-green-tint-60',
TextInteractiveLightThemePressed: 'text-kenvue-green-tint-20',
TextInteractiveLightThemeDisabled: as(
startWith(Button),
addProps({ disabled: 'true'}),
vitalColor.TextInteractiveLightDisabled,
),
// eslint-disable-next-line max-len
TextDarkThemeBase: as(vitalColor.TextDarkBase, vitalColor.BackgroundInteractiveLightDisabled, 'p-8px'),
TextLightThemeBase: vitalColor.TextLightBase,
TextInteractiveLightThemeHover: 'text-kenvue-green-shade-80',
TextDarkThemeBase: vitalColor.TextDarkBase,
TextLightThemeBase: as(vitalColor.TextLightBase, vitalColor.BackgroundInteractiveDarkIdle, 'p-8px'),
BorderInteractiveLightThemeFocus: 'text-kenvue-green-tint-60',
};

// const SpecialColors = {
Expand Down

5 comments on commit c7cec79

@vercel
Copy link

@vercel vercel bot commented on c7cec79 Aug 24, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on c7cec79 Aug 24, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

bodiless-js-examples – ./sites/vital-examples

bodiless-js-examples-git-main-jnj-demo-account.vercel.app
bodiless-js-examples-jnj-demo-account.vercel.app
bodiless-js-examples.vercel.app

@vercel
Copy link

@vercel vercel bot commented on c7cec79 Aug 24, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

bodiless-js – ./sites/vital-demo

bodiless-js-jnj-demo-account.vercel.app
bodiless-js-git-main-jnj-demo-account.vercel.app
bodiless-js.vercel.app

@vercel
Copy link

@vercel vercel bot commented on c7cec79 Aug 24, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

bodiless-js-gatsby – ./sites/vital-demo

bodiless-js-gatsby-git-main-jnj-demo-account.vercel.app
bodiless-js-gatsby-jnj-demo-account.vercel.app
bodiless-js-gatsby.vercel.app

@vercel
Copy link

@vercel vercel bot commented on c7cec79 Aug 24, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

bodiless-js-next – ./sites/vital-demo-next

bodiless-js-next-git-main-jnj-demo-account.vercel.app
bodiless-js-next-jnj-demo-account.vercel.app
bodiless-js-next.vercel.app

Please sign in to comment.