Skip to content

Commit

Permalink
fix(tailwind): set disablePreflight to false by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mainframev committed Dec 20, 2023
1 parent d95b80d commit 183ae0d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`orbitPreset should match snapshot 1`] = `
exports[`orbitPreset should have preflight disabled 1`] = `
{
"blocklist": [],
"content": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import resolveConfig from "tailwindcss/resolveConfig";
import orbitPreset from "../..";

describe("orbitPreset", () => {
it("should match snapshot", () => {
const cfg = resolveConfig(orbitPreset());
it("should have preflight disabled", () => {
const cfg = resolveConfig(orbitPreset({ disablePreflight: true }));
expect(cfg).toMatchSnapshot();
expect(cfg.corePlugins).not.toContain("preflight");
});
Expand All @@ -13,4 +13,9 @@ describe("orbitPreset", () => {
const config = resolveConfig(orbitPreset({ disablePreflight: false }));
expect(config.corePlugins).toContain("preflight");
});

it("should have enabled by default", () => {
const config = resolveConfig(orbitPreset());
expect(config.corePlugins).toContain("preflight");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const getBackgroundColors = (tokens: typeof defaultTokens) => {
};

const cfg = (options?: Options): Config => {
const { disablePreflight = true } = options || {};
const { disablePreflight = false } = options || {};
// make palette colors (foundation colors) defined as css vars and make components tokens inherit it
const tokens = getTokens(cssVarsFoundation);
const componentTokens = getComponentLevelTokens(tokens);
Expand All @@ -85,7 +85,7 @@ const cfg = (options?: Options): Config => {
content: ["auto"],
presets: [orbitFoundationPreset(tokens)],
corePlugins: {
preflight: disablePreflight ? false : undefined,
preflight: !disablePreflight,
},
theme: {
extend: {
Expand Down

0 comments on commit 183ae0d

Please sign in to comment.