Skip to content

Commit

Permalink
Don't explicitly set font/line-height on body, inherit from html inst…
Browse files Browse the repository at this point in the history
…ead (#2729)
  • Loading branch information
adamwathan committed Nov 4, 2020
1 parent f82cab1 commit 9585ae1
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 5 deletions.
12 changes: 11 additions & 1 deletion __tests__/fixtures/tailwind-output-flagged.css
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,21 @@ ul {
* to override it to ensure consistency even when using the default theme.
*/

html, body {
html {
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 1 */
line-height: 1.5; /* 2 */
}

/**
* Inherit font-family and line-height from `html` so users can set them as
* a class directly on the `html` element.
*/

body {
font-family: inherit;
line-height: inherit;
}

/**
* 1. Prevent padding and border from affecting element width.
*
Expand Down
12 changes: 11 additions & 1 deletion __tests__/fixtures/tailwind-output-important.css
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,21 @@ ul {
* to override it to ensure consistency even when using the default theme.
*/

html, body {
html {
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 1 */
line-height: 1.5; /* 2 */
}

/**
* Inherit font-family and line-height from `html` so users can set them as
* a class directly on the `html` element.
*/

body {
font-family: inherit;
line-height: inherit;
}

/**
* 1. Prevent padding and border from affecting element width.
*
Expand Down
12 changes: 11 additions & 1 deletion __tests__/fixtures/tailwind-output-no-color-opacity.css
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,21 @@ ul {
* to override it to ensure consistency even when using the default theme.
*/

html, body {
html {
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 1 */
line-height: 1.5; /* 2 */
}

/**
* Inherit font-family and line-height from `html` so users can set them as
* a class directly on the `html` element.
*/

body {
font-family: inherit;
line-height: inherit;
}

/**
* 1. Prevent padding and border from affecting element width.
*
Expand Down
12 changes: 11 additions & 1 deletion __tests__/fixtures/tailwind-output.css
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,21 @@ ul {
* to override it to ensure consistency even when using the default theme.
*/

html, body {
html {
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 1 */
line-height: 1.5; /* 2 */
}

/**
* Inherit font-family and line-height from `html` so users can set them as
* a class directly on the `html` element.
*/

body {
font-family: inherit;
line-height: inherit;
}

/**
* 1. Prevent padding and border from affecting element width.
*
Expand Down
13 changes: 12 additions & 1 deletion src/plugins/css/preflight.css
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,22 @@ ul {
* to override it to ensure consistency even when using the default theme.
*/

html, body {
html {
font-family: theme('fontFamily.sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); /* 1 */
line-height: 1.5; /* 2 */
}


/**
* Inherit font-family and line-height from `html` so users can set them as
* a class directly on the `html` element.
*/

body {
font-family: inherit;
line-height: inherit;
}

/**
* 1. Prevent padding and border from affecting element width.
*
Expand Down

0 comments on commit 9585ae1

Please sign in to comment.