Skip to content
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
Components: Cleanup unused ToggleGroupControl config values
  • Loading branch information
tyxla committed Sep 18, 2024
commit 96046db309449629b3e0d6aa12f0a6ac54c4179f
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const buttonView = ( {
}

&:active {
background: ${ CONFIG.toggleGroupControlBackgroundColor };
background: ${ CONFIG.controlBackgroundColor };
}

${ isDeselectable && deselectable }
Expand Down
16 changes: 1 addition & 15 deletions packages/components/src/utils/config-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,23 @@ import { COLORS } from './colors-values';
const CONTROL_HEIGHT = '36px';

const CONTROL_PROPS = {
controlSurfaceColor: COLORS.white,
controlTextActiveColor: COLORS.theme.accent,

// These values should be shared with TextControl.
controlPaddingX: 12,
controlPaddingXSmall: 8,
controlPaddingXLarge: 12 * 1.3334, // TODO: Deprecate

controlBackgroundColor: COLORS.white,
controlBoxShadow: 'transparent',
controlBoxShadowFocus: `0 0 0 0.5px ${ COLORS.theme.accent }`,
controlDestructiveBorderColor: COLORS.alert.red,
controlHeight: CONTROL_HEIGHT,
controlHeightXSmall: `calc( ${ CONTROL_HEIGHT } * 0.6 )`,
controlHeightSmall: `calc( ${ CONTROL_HEIGHT } * 0.8 )`,
controlHeightLarge: `calc( ${ CONTROL_HEIGHT } * 1.2 )`,
controlHeightXLarge: `calc( ${ CONTROL_HEIGHT } * 1.4 )`,
};

const TOGGLE_GROUP_CONTROL_PROPS = {
toggleGroupControlBackgroundColor: CONTROL_PROPS.controlBackgroundColor,
toggleGroupControlBorderColor: COLORS.ui.border,
toggleGroupControlBackdropBackgroundColor:
CONTROL_PROPS.controlSurfaceColor,
toggleGroupControlBackdropBorderColor: COLORS.ui.border,
toggleGroupControlButtonColorActive: CONTROL_PROPS.controlBackgroundColor,
};

// Using Object.assign to avoid creating circular references when emitting
// TypeScript type declarations.
export default Object.assign( {}, CONTROL_PROPS, TOGGLE_GROUP_CONTROL_PROPS, {
export default Object.assign( {}, CONTROL_PROPS, {
colorDivider: 'rgba(0, 0, 0, 0.1)',
colorScrollbarThumb: 'rgba(0, 0, 0, 0.2)',
colorScrollbarThumbHover: 'rgba(0, 0, 0, 0.5)',
Expand Down