Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Tailwind 3.0 #515

Merged
merged 8 commits into from Nov 17, 2021
Merged
2 changes: 1 addition & 1 deletion app/pages/ProjectsPage.tsx
Expand Up @@ -27,7 +27,7 @@ const Metric = ({ label, value, className }: MetricProps) => (
<div className="flex">
<div className="text-display-lg mr-4">{value}</div>
<div>
<SparklineSVG className="stroke-current text-green-500 w-full" />
<SparklineSVG className="stroke-green-500 w-full" />
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/lib/breadcrumbs/Breadcrumbs.tsx
Expand Up @@ -11,7 +11,7 @@ export const Breadcrumbs = ({ data }: BreadcrumbsProps) => (
<ol className="text-xs font-mono uppercase mb-6">
{data.map(({ href, label }) => (
<li
className="inline-block first-of-type:before:content-none
className="inline-block before:first-of-type:content-none
before:content-['/'] before:mx-2 before:text-gray-400"
key={`${href}-${label}`}
>
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/lib/radio/Radio.tsx
Expand Up @@ -44,7 +44,7 @@ const cardLabelStyles = `
peer-disabled:hover:bg-gray-500

children:py-2 children:px-4 children:-mx-4 children:border-gray-400
children:first:-mt-2 children:last:-mb-2
first:children:-mt-2 last:children:-mb-2
peer-checked:children:border-green-500
cursor-pointer peer-disabled:cursor-default
`
Expand Down
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -108,8 +108,7 @@
"postcss-nesting": "^8.0.1",
"prettier": "2.4.0",
"rollup": "^2.52.7",
"tailwindcss": "^2.2.0",
"tailwindcss-children": "^2.1.0",
"tailwindcss": "^3.0.0-alpha.2",
"ts-node": "^9.1.1",
"tsconfig-paths-webpack-plugin": "^3.5.1",
"typescript": "~4.4.2",
Expand Down
26 changes: 6 additions & 20 deletions tailwind.config.js
Expand Up @@ -3,15 +3,10 @@
/** @type {import('tailwindcss/lib/util/createPlugin').default} */
// @ts-ignore
const plugin = require('tailwindcss/plugin')
const defaultConfig = require('tailwindcss/defaultConfig')

const childrenPlugin = require('tailwindcss-children')

/** @type {import('tailwindcss/tailwind-config').TailwindConfig} */
module.exports = {
mode: 'jit',
purge: ['./libs/ui/**/*.{ts,tsx,mdx}', './app/**/*.{ts,tsx}'],
darkMode: false,
content: ['./libs/ui/**/*.{ts,tsx,mdx}', './app/**/*.{ts,tsx}'],
theme: {
extend: {
borderRadius: {
Expand Down Expand Up @@ -74,20 +69,11 @@ module.exports = {
},
},
plugins: [
// imitation of the twin.macro svg: variant. svg:text-green-500 puts green
// on an SVG that's an immediate child of the element
plugin(function ({ addVariant, e }) {
addVariant('svg', ({ modifySelectors, separator }) => {
modifySelectors(
({ className }) => `.${e(`svg${separator}${className}`)} > svg`
)
})
plugin(({ addVariant }) => {
// imitation of the twin.macro svg: variant. svg:text-green-500 puts green
// on an SVG that's an immediate child of the element
addVariant('svg', '& > svg')
addVariant('children', '& > *')
}),
childrenPlugin,
],
/**
* TODO: This isn't respected, need an upstream fix.
* @see https://github.com/tailwindlabs/tailwindcss/issues/3949
*/
variantOrder: ['children', ...defaultConfig.variantOrder, 'svg'],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zephraph I think this isn't needed anymore but let me know

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's working, it's not needed 😄. I mean, this never did anything to begin with due to the upstream bug.

}