Skip to content

Commit cd2f855

Browse files
authored
Merge pull request #363 from tailwindcss/fix-362
Undo border-style reset Normalize applies to images
2 parents f87c930 + 6493bda commit cd2f855

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

css/preflight.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,21 @@ ul {
527527
* Tailwind custom reset styles
528528
*/
529529

530+
/**
531+
* Allow adding a border to an element by just adding a border-width.
532+
*
533+
* By default, the way the browser specifies that an element should have no
534+
* border is by setting it's border-style to `none` in the user-agent
535+
* stylesheet.
536+
*
537+
* In order to easily add borders to elements by just setting the `border-width`
538+
* property, we change the default border-style for all elements to `solid`, and
539+
* use border-width to hide them instead. This way our `border` utilities only
540+
* need to set the `border-width` property instead of the entire `border`
541+
* shorthand, making our border utilities much more straightforward to compose.
542+
*
543+
* https://github.com/tailwindcss/tailwindcss/pull/116
544+
*/
530545
*,
531546
*::before,
532547
*::after {
@@ -535,6 +550,19 @@ ul {
535550
border-color: config('borderColors.default', currentColor);
536551
}
537552

553+
/**
554+
* Undo the `border-style: none` reset that Normalize applies to images so that
555+
* our `border-{width}` utilities have the expected effect.
556+
*
557+
* The Normalize reset is unnecessary for us since we default the border-width
558+
* to 0 on all elements.
559+
*
560+
* https://github.com/tailwindcss/tailwindcss/issues/362
561+
*/
562+
img {
563+
border-style: solid;
564+
}
565+
538566
/**
539567
* Temporary reset for a change introduced in Chrome 62 but now reverted.
540568
*

0 commit comments

Comments
 (0)