From c3886066cc82454711724a8427d2c126942efd2b Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Fri, 1 Mar 2019 20:53:01 -0500 Subject: [PATCH] Reset heading styles in preflight Set all headings to inherit the parent font size and reset the font weight to normal. This prevents you from accidentally using browser default sizes in your designs and deviating from your design system. --- __tests__/fixtures/tailwind-output-important.css | 10 ++++++++++ __tests__/fixtures/tailwind-output.css | 10 ++++++++++ src/plugins/css/preflight.css | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/__tests__/fixtures/tailwind-output-important.css b/__tests__/fixtures/tailwind-output-important.css index 6698fc65c..fb274e761 100644 --- a/__tests__/fixtures/tailwind-output-important.css +++ b/__tests__/fixtures/tailwind-output-important.css @@ -478,6 +478,16 @@ table { border-collapse: collapse; } +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: 100%; + font-weight: normal; +} + .container { width: 100%; } diff --git a/__tests__/fixtures/tailwind-output.css b/__tests__/fixtures/tailwind-output.css index b0c2065ee..c5dc7a8b5 100644 --- a/__tests__/fixtures/tailwind-output.css +++ b/__tests__/fixtures/tailwind-output.css @@ -478,6 +478,16 @@ table { border-collapse: collapse; } +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: 100%; + font-weight: normal; +} + .container { width: 100%; } diff --git a/src/plugins/css/preflight.css b/src/plugins/css/preflight.css index 24d4dcc20..b12384330 100644 --- a/src/plugins/css/preflight.css +++ b/src/plugins/css/preflight.css @@ -123,3 +123,13 @@ button, table { border-collapse: collapse; } + +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: 100%; + font-weight: normal; +}