Custom config isn't working
See original GitHub issueWhenever adding a new “rule” to the config it won’t be applyed, and is so on not usable. whether as a class name nor in @apply.
this is my tailwind.config.js :
module.exports = {
purge: [],
theme: {
fontFamily: {
display: ["Roboto", "sans-serif"],
body: ["Roboto", "sans-serif"]
},
colors: {
primary: "#9cdbff"
},
extends: {
margin: {
p49: "49%",
p32: "32%"
}
}
},
variants: {},
plugins: []
};
my postcss.config.js :
const autoprefixer = require("autoprefixer");
const tailwindcss = require("tailwindcss");
const postcssPurgecss = require(`@fullhuman/postcss-purgecss`);
const purgecss = postcssPurgecss({
// Specify the paths to all of the template files in your project.
content: ["./public/**/*.html", "./src/**/*.vue"],
// Include any special characters you're using in this regular expression.
// See: https://tailwindcss.com/docs/controlling-file-size/#understanding-the-regex
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [],
// Whitelist auto generated classes for transitions and router links.
// From: https://github.com/ky-is/vue-cli-plugin-tailwind
whitelistPatterns: [
/-(leave|enter|appear)(|-(to|from|active))$/,
/^(?!(|.*?:)cursor-move).+-move$/,
/^router-link(|-exact)-active$/
]
});
module.exports = {
plugins: {
tailwindcss,
autoprefixer,
...(process.env.NODE_ENV === "production" ? [purgecss] : [])
}
};
If I try to use a custom class in @apply e.g. my primary color it results in this error:
`@apply` cannot be used with `.bg-primary` because `.bg-primary` either cannot be found, or its actual definition includes a pseudo-selector like :hover, :active, etc. If you're sure that `.bg-primary` exists, make sure that any `@import` statements are being properly processed *before* Tailwind CSS sees your CSS, as `@apply` can only be used for classes in the same CSS tree.`
primary is shown by vs-code where i added stylelint so it seems that it detects but doesn’t apply properly.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
custom config not executed · Issue #1326 · NvChad ... - GitHub
I tried to reinstall nvchad but didn't work. Seems like the files in the custom/ folder aren't even executed. ... Steps to reproduce...
Read more >Custom configuration file custom_config.js not working?
I am trying to use a custom configuration file instead of the default config.js file in the ckeditor root. I have placed a...
Read more >Custom extension config stopped working - Configuration
I have a custom stanza in my extension_custom.conf to alter the CID for incoming calls. [from-trunk-custom] exten => _X.,1,NOOP("Entered ...
Read more >custom config not working | CKEditor.com Forums
It seems to be working fine, but I wanted to use a custom config to set up uicolor and toolbar. I can't seem...
Read more >Custom config not working : r/tf2 - Reddit
So i wanted to have a custom config, its not an autoexec because the autoexec is replaced/used by my mastercomfig config, its a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’re welcome, I’m glad it works now.
Worked fine. Issues lied in postcss.config.