Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't explicitly set font/line-height on body, inherit from html instead #2729

Merged
merged 1 commit into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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