Skip to content

Commit

Permalink
Rename color value ui.brand to ui.theme. Hardcode color variable fall…
Browse files Browse the repository at this point in the history
…backs. (#24059)
  • Loading branch information
Q authored Jul 20, 2020
1 parent 771e557 commit ac58042
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export const Container = styled.div`

export const Side = styled.div`
box-sizing: border-box;
background: ${ color( 'ui.brand' ) };
background: ${ color( 'blue.wordpress.700' ) };
background: ${ color( 'ui.theme' ) };
filter: brightness( 1 );
opacity: 0;
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ export const PointerIconPathOutline = styled( Path )`
`;

export const PointerIconPathFill = styled( Path )`
fill: ${ color( 'ui.brand' ) };
fill: ${ color( 'blue.wordpress.700' ) };
fill: ${ color( 'ui.theme' ) };
`;
2 changes: 1 addition & 1 deletion packages/components/src/range-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function RangeControl(
beforeIcon,
className,
currentInput,
color: colorProp = color( 'ui.brand' ),
color: colorProp = color( 'ui.theme' ),
disabled = false,
help,
initialPosition,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/range-control/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const DefaultExample = () => {
afterIcon: text( 'afterIcon', '' ),
allowReset: boolean( 'allowReset', false ),
beforeIcon: text( 'beforeIcon', '' ),
color: text( 'color', color( 'ui.brand' ) ),
color: text( 'color', color( 'ui.theme' ) ),
disabled: boolean( 'disabled', false ),
help: text( 'help', '' ),
label: text( 'label', 'Range Label' ),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const wrapperMargin = ( { marks } ) =>

export const Wrapper = styled.span`
box-sizing: border-box;
color: ${ color( 'blue.medium.focus' ) };
display: block;
flex: 1;
padding-top: 15px;
Expand Down
10 changes: 8 additions & 2 deletions packages/components/src/utils/colors-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,18 @@ export const ALERT = {
green: '#4ab866',
};

export const ADMIN = {
theme: `var( --wp-admin-theme-color, ${ BLUE.wordpress[ 700 ] })`,
themeDark10: `var( --wp-admin-theme-color-darker-10, ${ BLUE.medium.focus })`,
};

// Namespaced values for raw colors hex codes
export const UI = {
theme: ADMIN.theme,
background: BASE.white,
backgroundDisabled: LIGHT_GRAY[ 200 ],
brand: `var( --wp-admin-theme-color, ${ BLUE.wordpress[ 700 ] })`,
border: G2.darkGray.primary,
borderFocus: `var( --wp-admin-theme-color-darker-10, ${ BLUE.medium.focus })`,
borderFocus: ADMIN.themeDark10,
borderDisabled: DARK_GRAY[ 700 ],
borderLight: LIGHT_GRAY[ 600 ],
label: DARK_GRAY[ 500 ],
Expand All @@ -158,6 +163,7 @@ export const COLORS = {
lightGrayLight: LIGHT_OPACITY_LIGHT,
blue: merge( {}, BLUE, G2.blue ),
alert: ALERT,
admin: ADMIN,
ui: UI,
};

Expand Down

0 comments on commit ac58042

Please sign in to comment.