Skip to content

Commit

Permalink
feat: allow to use tailwindconf inside componenent
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Lebeau committed Jan 29, 2024
1 parent 99db4b3 commit 651f07d
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 14 deletions.
1 change: 1 addition & 0 deletions build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"devDependencies": {
"@esbuild-kit/cjs-loader": "^2.4.2",
"@pnpm/types": "^9.0.0",
"@rollup/plugin-json": "^6.1.0",
"@types/rollup-plugin-css-only": "^3.1.0",
"unbuild": "^1.2.0",
"vue": "^3.2.47"
Expand Down
3 changes: 3 additions & 0 deletions build/src/tasks/full-bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import esbuild from 'rollup-plugin-esbuild'
import { parallel } from 'gulp'
import glob from 'fast-glob'
import { camelCase, upperFirst } from 'lodash-unified'
import json from '@rollup/plugin-json'
import { version } from '../../../packages/puik/version'
import { PuikAlias } from '../plugins/puik-alias'
import {
Expand Down Expand Up @@ -48,6 +49,7 @@ async function buildFullEntry(minify: boolean) {
'process.env.NODE_ENV': JSON.stringify('production'),
},
}),
json(),
],
external: await generateExternal({ full: true }),
})
Expand Down Expand Up @@ -97,6 +99,7 @@ async function buildFullLocale(minify: boolean) {
sourceMap: minify,
target,
}),
json(),
],
})
await writeBundles(bundle, [
Expand Down
2 changes: 2 additions & 0 deletions build/src/tasks/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import esbuild from 'rollup-plugin-esbuild'
import glob from 'fast-glob'
import json from '@rollup/plugin-json'
import {
puikRoot,
pkgRoot,
Expand Down Expand Up @@ -44,6 +45,7 @@ export const buildModules = async () => {
'.vue': 'ts',
},
}),
json(),
],
external: await generateExternal({ full: false }),
treeshake: false,
Expand Down
7 changes: 7 additions & 0 deletions packages/components/icon/stories/icon.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export default {
dataTest: {
description: 'Set the data-test attribute',
},
isDisabled: {
description: 'If the icon is disable',
control: {
type: 'boolean',
},
},
},
} as Meta

Expand All @@ -56,6 +62,7 @@ export const Default = {
fontSize: 24,
nodeType: 'span',
dataTest: '',
isDisabled: false,
},

parameters: {
Expand Down
6 changes: 6 additions & 0 deletions packages/puik/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"compilerOptions": {
"moduleResolution": "NodeNext",
"module": "NodeNext"
}
}
7 changes: 4 additions & 3 deletions packages/tailwind-preset/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const Puiktheme = require('./theme')
// const Puiktheme = require('./theme')
import PuikTheme from './theme'

module.exports = {
theme: Puiktheme,
export default {
theme: PuikTheme,
}
4 changes: 3 additions & 1 deletion packages/theme/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import tailwindConfig from '@puik/tailwind-preset'

/* eslint-disable @typescript-eslint/no-var-requires */
module.exports = {
presets: [require('@puik/tailwind-preset')],
presets: [tailwindConfig],
content: ['./src/**/*.scss'],
plugins: [require('tailwind-scrollbar')({ nocompatible: true })],
darkMode: 'class', // To remove if we wanna use the css' prefers-color-scheme feature (dark mode based on OS/browser preference)
Expand Down
5 changes: 0 additions & 5 deletions packages/theme/tsconfig.json

This file was deleted.

28 changes: 23 additions & 5 deletions pnpm-lock.yaml

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

0 comments on commit 651f07d

Please sign in to comment.