From bdbec26136aa46ee0b384682548a19e00f662136 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Mon, 3 Feb 2020 11:50:40 -0500 Subject: [PATCH] Use font-sans as the default font, not the system font --- __tests__/fixtures/tailwind-output-important.css | 3 ++- __tests__/fixtures/tailwind-output.css | 3 ++- src/plugins/css/preflight.css | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/__tests__/fixtures/tailwind-output-important.css b/__tests__/fixtures/tailwind-output-important.css index 51991764faed..af36948570e1 100644 --- a/__tests__/fixtures/tailwind-output-important.css +++ b/__tests__/fixtures/tailwind-output-important.css @@ -407,7 +407,8 @@ ul { */ /** - * 1. Use Tailwind's default sans-serif font stack as a sane default. + * 1. Use the user's configured `sans` font-family (with Tailwind's default + * sans-serif font stack as a fallback) as a sane default. * 2. Use Tailwind's default "normal" line-height so the user isn't forced * to override it to ensure consistency even when using the default theme. */ diff --git a/__tests__/fixtures/tailwind-output.css b/__tests__/fixtures/tailwind-output.css index c9e9405dbc8b..8cde35d567d1 100644 --- a/__tests__/fixtures/tailwind-output.css +++ b/__tests__/fixtures/tailwind-output.css @@ -407,7 +407,8 @@ ul { */ /** - * 1. Use Tailwind's default sans-serif font stack as a sane default. + * 1. Use the user's configured `sans` font-family (with Tailwind's default + * sans-serif font stack as a fallback) as a sane default. * 2. Use Tailwind's default "normal" line-height so the user isn't forced * to override it to ensure consistency even when using the default theme. */ diff --git a/src/plugins/css/preflight.css b/src/plugins/css/preflight.css index c3a622d72741..8f80de444a5d 100644 --- a/src/plugins/css/preflight.css +++ b/src/plugins/css/preflight.css @@ -57,13 +57,14 @@ ul { */ /** - * 1. Use Tailwind's default sans-serif font stack as a sane default. + * 1. Use the user's configured `sans` font-family (with Tailwind's default + * sans-serif font stack as a fallback) as a sane default. * 2. Use Tailwind's default "normal" line-height so the user isn't forced * to override it to ensure consistency even when using the default theme. */ html { - font-family: Inter, 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 */ + font-family: theme('fontFamily.sans', Inter, 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 */ }