Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added custom.css
Empty file.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/tailwind.css">
<link rel="stylesheet" href="/styles.css">
<link rel="stylesheet" href="/custom.css">
<title>Document</title>
</head>

<body>
<p class="font-bold text-blue-400 custom:text-green-500 text-[4rem]">testing</p>
<div class="fuck-you"></div>
</body>

</html>
23 changes: 2 additions & 21 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -596,25 +596,6 @@ video {
--tw-backdrop-sepia: var(--tw-empty,/*!*/ /*!*/);
--tw-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
}
.text-\[4rem\] {
font-size: 4rem;
:root {
font-size: 62.5%;
}
.font-bold {
font-weight: 700;
}
.text-blue-400 {
--tw-text-opacity: 1;
color: rgba(96, 165, 250, var(--tw-text-opacity));
}
@media (min-width: 400px) {

.custom\:text-red-500 {
--tw-text-opacity: 1;
color: rgba(239, 68, 68, var(--tw-text-opacity));
}

.custom\:text-green-500 {
--tw-text-opacity: 1;
color: rgba(16, 185, 129, var(--tw-text-opacity));
}
}
64 changes: 62 additions & 2 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
const plugin = require('tailwindcss/plugin')

const labelChildOnChecked = plugin(function ({ addVariant, e }) {
addVariant('labelChildOnChecked', ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.${e(`labelChildOnChecked${separator}${className}`)}:checked + * *`;
})
});
});

// :focus, :focus-within, :hover, :checked

module.exports = {
mode: 'jit',
purge: ['./index.html'],
Expand All @@ -11,9 +23,57 @@ module.exports = {
},
variants: {
extend: {
backgroundColor: ['checked'],
backgroundColor: ['checked', 'important', 'labelChildOnChecked'],
borderColor: ['checked'],
translate: ['labelChildOnChecked'],
transform: ['labelChildOnChecked']
}
},
plugins: [],
plugins: [
plugin(function({ addVariant }) {
addVariant('important', ({ container }) => {
container.walkRules(rule => {
rule.selector = `.\\!${rule.selector.slice(1)}`
rule.walkDecls(decl => {
decl.important = true
})
})
})
})
, labelChildOnChecked
],
}
// module.exports = {
// mode: 'jit',
// purge: ['./index.html'],
// darkMode: 'media', // or 'media' or 'class'
// theme: {
// extend: {
// screens: {
// 'custom': '400px'
// }
// },
// },
// variants: {
// extend: {
// backgroundColor: ['checked', 'checkedSibling'],
// borderColor: ['checked', 'checkedSibling'],
// }
// },
// plugins: [
// plugin(function ({addVariant, e}) {
// addVariant("checkedSibling", ({ container }) => {
// rule.selector = `:checked + .checkedSibling\\:${rule.selector.slice(1)}`
// })
// })
// ],
// }


// plugin(function ({ addVariant, e }) {
// addVariant("focused-sibling", ({ container }) => {
// container.walkRules((rule) => {
// rule.selector = `:focus + .focused-sibling\\:${rule.selector.slice(1)}`;
// });
// });
// });
5 changes: 4 additions & 1 deletion tailwind.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@tailwind base;
:root {
font-size: 62.5%;
}
@tailwind components;
@tailwind utilities;
@tailwind utilities;