Skip to content

Commit

Permalink
Meta: Add tailwind prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
filiphsps committed Sep 24, 2024
1 parent 7cdd1fd commit dd8deb1
Show file tree
Hide file tree
Showing 22 changed files with 71 additions and 38 deletions.
5 changes: 5 additions & 0 deletions .changeset/sixty-clocks-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@nordcom/nordstar': patch
---

- Add tailwind prefix.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ public/

vite.config.ts
vitest.config.ts

postcss.config.cjs
postcss.config.js

tailwind.config.cjs
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"eslint-config-next": "14.2.13",
"eslint": "8.57.1",
"postcss": "8.4.47",
"postcss-import": "16.1.0",
"prettier": "3.3.3",
"rimraf": "6.0.1",
"tailwindcss": "3.4.13",
Expand Down
5 changes: 3 additions & 2 deletions docs/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
'postcss-import': {},
'tailwindcss': {},
'autoprefixer': {}
}
};
23 changes: 5 additions & 18 deletions docs/tailwind.config.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ['class'],
content: ['./src/**/*.{ts,tsx}'],
content: [
'./src/**/*.{js,ts,jsx,tsx,mdx}',
'./node_modules/@nordcom/nordstar/**/*.{js,jsx}',
'../node_modules/@nordcom/nordstar/**/*.{js,jsx}'
],
prefix: '',
theme: {
container: {
Expand Down Expand Up @@ -31,9 +35,6 @@ module.exports = {
sans: ['var(--font-sans, var(--font-fallback))', 'sans-serif'],
mono: ['var(--font-mono)', 'monospace']
},
fontWeight: {
inherit: 'inherit'
},
colors: {
foreground: {
DEFAULT: 'hsl(var(--color-foreground))',
Expand Down Expand Up @@ -64,20 +65,6 @@ module.exports = {
},
aspectRatio: {
'3/2': '3 / 2'
},
keyframes: {
'accordion-down': {
from: { height: '0' },
to: { height: 'var(--radix-accordion-content-height)' }
},
'accordion-up': {
from: { height: 'var(--radix-accordion-content-height)' },
to: { height: '0' }
}
},
animation: {
'accordion-down': 'accordion-down 0.2s ease-out',
'accordion-up': 'accordion-up 0.2s ease-out'
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"build:packages": "turbo build --filter=!@nordcom/nordstar-docs --filter=!@nordcom/nordstar-storybook",
"build:storybook": "turbo build --filter=@nordcom/nordstar-storybook",
"typecheck": "turbo typecheck",
"lint": "eslint **/src/**/*.{ts,tsx}",
"prettier": "prettier --check **/src/**/*.{ts,tsx}",
"lint": "eslint --ignore-pattern ./packages \"./**/*.{cjs,mjs,ts,tsx}\"",
"prettier": "prettier --check \"./**/*.{cjs,mjs,ts,tsx,scss,json}\" \"!\\packages/**\"",
"fix": "concurrently -i pnpm:fix:*",
"fix:docs": "turbo fix --filter=@nordcom/nordstar-docs",
"fix:packages": "turbo fix --filter=!@nordcom/nordstar-docs --filter=!@nordcom/nordstar-storybook",
Expand Down
1 change: 1 addition & 0 deletions packages/components/accented/src/globals.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
1 change: 1 addition & 0 deletions packages/components/button/src/globals.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
1 change: 1 addition & 0 deletions packages/components/card/src/globals.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
1 change: 1 addition & 0 deletions packages/components/details/src/globals.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
1 change: 1 addition & 0 deletions packages/components/header/src/globals.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
1 change: 1 addition & 0 deletions packages/components/heading/src/globals.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
1 change: 1 addition & 0 deletions packages/components/input/src/globals.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
4 changes: 2 additions & 2 deletions packages/components/input/src/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const Input = forwardRef<'input' | 'textarea', InputProps<As>>(
'pointer-events-none select-none text-xs font-extrabold uppercase transition-all [transform:translateZ(0)_translateY(0)]',
!placeholder &&
!contents &&
'-mb-2 text-inherit [transform:translateY(.65rem)] group-first-of-type:-mb-0 group-focus-within:translate-y-0 group-focus-within:text-sm'
'-mb-2 text-inherit group-first-of-type:-mb-0 group-focus-within:translate-y-0 group-focus-within:text-sm [transform:translateY(.65rem)]'
)}
data-full-height={!placeholder && !contents}
>
Expand All @@ -168,7 +168,7 @@ const Input = forwardRef<'input' | 'textarea', InputProps<As>>(
ref={ref}
className={cn(
styles.input,
'relative h-full w-full appearance-none border-0 bg-transparent p-0 text-sm leading-none outline-0 [font-size:inherit] placeholder:text-foreground-highlight placeholder:transition-opacity placeholder:[font-size:inherit]',
'relative h-full w-full appearance-none border-0 bg-transparent p-0 text-sm leading-none outline-0 placeholder:text-foreground-highlight placeholder:transition-opacity [font-size:inherit] placeholder:[font-size:inherit]',
label && as !== 'textarea' && 'absolute inset-y-0 h-15 pt-3',
as === 'textarea' && 'h-full min-h-20 leading-normal'
)}
Expand Down
1 change: 1 addition & 0 deletions packages/components/label/src/globals.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
1 change: 1 addition & 0 deletions packages/components/view/src/globals.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
1 change: 1 addition & 0 deletions packages/core/nordstar/src/globals.css
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
4 changes: 3 additions & 1 deletion packages/core/system/src/nordstar-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ export const NordstarProvider = ({ theme, children, className, ...props }: Nords

return (
<>
<style data-testid="style">{css}</style>
<style data-testid="style" suppressHydrationWarning={true}>
{css}
</style>
<div
id="nordstar"
className={cn('contents bg-background text-[16px] font-medium text-foreground', className)}
Expand Down
1 change: 1 addition & 0 deletions plop/component/src/globals.css.hbs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
38 changes: 28 additions & 10 deletions pnpm-lock.yaml

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

5 changes: 4 additions & 1 deletion tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
module.exports = {
darkMode: ['class'],
content: ['./{src,.storybook}/**/*.{ts,tsx}'],
prefix: '',
prefix: 'nordstar-',
theme: {
container: {
center: true,
Expand Down Expand Up @@ -88,5 +88,8 @@ module.exports = {
future: {
hoverOnlyWhenSupported: true
},
corePlugins: {
preflight: false
},
plugins: []
};
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export default defineConfig({
root: resolve(__dirname),
build: {
copyPublicDir: false,
cssCodeSplit: true,
cssMinify: true,
cssCodeSplit: false,
cssMinify: false,
emptyOutDir: true,
minify: false,
outDir: 'dist',
Expand Down

0 comments on commit dd8deb1

Please sign in to comment.