From 58f581ef320e758da479cefaebc47ea427044279 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Tue, 12 Mar 2019 11:17:35 -0400 Subject: [PATCH] Reset form elements even more aggressively --- __tests__/fixtures/tailwind-output-important.css | 14 ++++++++++++-- __tests__/fixtures/tailwind-output.css | 14 ++++++++++++-- src/plugins/css/preflight.css | 15 +++++++++++++-- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/__tests__/fixtures/tailwind-output-important.css b/__tests__/fixtures/tailwind-output-important.css index e37c560bf..f89a5fdf2 100644 --- a/__tests__/fixtures/tailwind-output-important.css +++ b/__tests__/fixtures/tailwind-output-important.css @@ -489,9 +489,11 @@ h6 { } /** - * Inherit color, font-weight, and line-height from the parent + * Reset form elements to inherit their styles from the parent * so that form elements don't inadvertently have any styles - * that deviate from your design system. + * that deviate from your design system. These styles + * supplement a partial reset that is already applied by + * normalize.css. */ button, @@ -499,9 +501,17 @@ input, optgroup, select, textarea { + padding: 0; + border-radius: 0; + background-color: transparent; color: inherit; font-weight: inherit; line-height: inherit; + font-style: inherit; + font-variant: inherit; + text-align: inherit; + text-transform: inherit; + letter-spacing: inherit; } .container { diff --git a/__tests__/fixtures/tailwind-output.css b/__tests__/fixtures/tailwind-output.css index da8803c5b..6650a5869 100644 --- a/__tests__/fixtures/tailwind-output.css +++ b/__tests__/fixtures/tailwind-output.css @@ -489,9 +489,11 @@ h6 { } /** - * Inherit color, font-weight, and line-height from the parent + * Reset form elements to inherit their styles from the parent * so that form elements don't inadvertently have any styles - * that deviate from your design system. + * that deviate from your design system. These styles + * supplement a partial reset that is already applied by + * normalize.css. */ button, @@ -499,9 +501,17 @@ input, optgroup, select, textarea { + padding: 0; + border-radius: 0; + background-color: transparent; color: inherit; font-weight: inherit; line-height: inherit; + font-style: inherit; + font-variant: inherit; + text-align: inherit; + text-transform: inherit; + letter-spacing: inherit; } .container { diff --git a/src/plugins/css/preflight.css b/src/plugins/css/preflight.css index 0a76210f9..5babbd2ae 100644 --- a/src/plugins/css/preflight.css +++ b/src/plugins/css/preflight.css @@ -135,16 +135,27 @@ h6 { } /** - * Inherit color, font-weight, and line-height from the parent + * Reset form elements to inherit their styles from the parent * so that form elements don't inadvertently have any styles - * that deviate from your design system. + * that deviate from your design system. These styles + * supplement a partial reset that is already applied by + * normalize.css. */ + button, input, optgroup, select, textarea { + padding: 0; + border-radius: 0; + background-color: transparent; color: inherit; font-weight: inherit; line-height: inherit; + font-style: inherit; + font-variant: inherit; + text-align: inherit; + text-transform: inherit; + letter-spacing: inherit; }