Skip to content

Commit

Permalink
[DSTSUP-58]chore: Add scoped preflight plugin to normalize the core (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahgm committed Mar 15, 2024
1 parent 95ce246 commit 8cc639d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/sharp-dolls-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@marigold/theme-core": patch
---

[DSTSUP-58]chore: Add scoped preflight plugin to normalize the core
13 changes: 13 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions themes/theme-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"cssnano": "6.0.5",
"postcss": "8.4.35",
"tailwindcss": "3.4.1",
"tailwindcss-scoped-preflight": "2.1.0",
"tsup": "8.0.2"
},
"dependencies": {
Expand Down
11 changes: 8 additions & 3 deletions themes/theme-core/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import type { Config } from 'tailwindcss';
import { scopedPreflightStyles } from 'tailwindcss-scoped-preflight';

import { preset } from './src/preset';

// Figma File: https://www.figma.com/file/RiWJBV4Z8L8ycVvUuMYXbm/%F0%9F%93%93-CR---Components-2022?node-id=1452-1785&t=YaLGVHzniD5mOtbJ-0
export default {
important: '[data-theme="core"]',
corePlugins: {
preflight: false,
},
content: [
'src/root.ts',
'src/colors.ts',
Expand All @@ -16,5 +14,12 @@ export default {
'!../../packages/{components,system}/**/*.{stories,test}.{tsx,ts}',
],
presets: [preset],
plugins: [
scopedPreflightStyles({
// data-app is defined in core
cssSelector: '[data-app]',
mode: 'matched only',
}),
],
safelist: [{ pattern: /(bg|text|border|shadow)-./ }],
} satisfies Config;

0 comments on commit 8cc639d

Please sign in to comment.