Skip to content

Commit

Permalink
BorderControl: Add box sizing reset (#42754)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw authored Jul 29, 2022
1 parent 13e3cac commit bc79532
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Unreleased

### Bug Fix

- `BorderControl`: Ensure box-sizing is reset for the control ([#42754](https://github.com/WordPress/gutenberg/pull/42754)).

### Enhancements

- Add `box-sizing` reset style mixin to utils ([#42754](https://github.com/WordPress/gutenberg/pull/42754)).

## 19.16.0 (2022-07-27)

### Bug Fix
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/border-control/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { css } from '@emotion/react';
/**
* Internal dependencies
*/
import { COLORS, CONFIG, rtl } from '../utils';
import { COLORS, CONFIG, boxSizingReset, rtl } from '../utils';
import { space } from '../ui/utils/space';
import {
StyledField,
Expand All @@ -31,6 +31,7 @@ export const borderControl = css`
border: 0;
padding: 0;
margin: 0;
${ boxSizingReset }
`;

export const innerWrapper = () => css`
Expand Down
14 changes: 14 additions & 0 deletions packages/components/src/utils/box-sizing.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* External dependencies
*/
import { css } from '@emotion/react';

export const boxSizingReset = css`
box-sizing: border-box;
*,
*::before,
*::after {
box-sizing: inherit;
}
`;
1 change: 1 addition & 0 deletions packages/components/src/utils/style-mixins.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { boxSizingReset } from './box-sizing';
export { rgba } from './colors';
export { reduceMotion } from './reduce-motion';
export { rtl } from './rtl';
Expand Down

0 comments on commit bc79532

Please sign in to comment.