tailwind-css

Bind multiple classes to a single variable

让人想犯罪 __ 提交于 2020-08-20 11:15:30
问题 While using Tailwind with utility-first approach to css, I often find the need to bind multiple classes to a single variable. For instance, to style an input form, I need to add border-red , color-red , etc if there is an error. Is there a nice and elegant way to express this in Vue instead of writing v-bind:class="{ 'border-red': error, 'text-red': error } ? 回答1: You can combine both classes into the same property: :class="{ 'border-red text-red': error }" 来源: https://stackoverflow.com

Loading custom fonts in Nuxt/Tailwind Project

荒凉一梦 提交于 2020-06-17 09:37:44
问题 Hi everybody and sorry my english. I have created a nuxt.js project with Tailwind. I´d like to custom my font family, so I downloaded some font files from Google Fonts. I have been reading Tailwind docs, but i can´t understand where do i have to place the font files and how to config Tailwind for loading the files. I´d be very gratefull if somebody could help me. 回答1: I'm assuming you're using the module @nuxtjs/tailwindcss. First, you'll have to run npm run build , so that tailwind files are

Loading custom fonts in Nuxt/Tailwind Project

假如想象 提交于 2020-06-17 09:37:36
问题 Hi everybody and sorry my english. I have created a nuxt.js project with Tailwind. I´d like to custom my font family, so I downloaded some font files from Google Fonts. I have been reading Tailwind docs, but i can´t understand where do i have to place the font files and how to config Tailwind for loading the files. I´d be very gratefull if somebody could help me. 回答1: I'm assuming you're using the module @nuxtjs/tailwindcss. First, you'll have to run npm run build , so that tailwind files are

How do you get rid of these SASS linting errors when using Tailwind-CSS?

微笑、不失礼 提交于 2020-06-12 03:47:14
问题 I'm using Tailwind in a Gatsby.js project. My environment is VSCode, using Prettier code formatter. How do I get rid of these linting error alerts? 回答1: Solution for both .css and .scss At the root level of your project, update or create a dir .vscode with a file settings.json : Add the following to .vscode/settings.json: { "css.validate": false, "less.validate": false, "scss.validate": false } Install the vscode-stylelint extension install stylelint-config-standard: npm i stylelint-config

Rails 6 and Tailwind CSS does not deploy to Heroku

不羁岁月 提交于 2020-04-13 17:09:26
问题 I have a Rails 6 app that was successfully deployed to Heroku and worked on localhost:3000. I added tailwindcss via yarn and webpack. It runs perfectly fine on localhost, but does not run on heroku. When I run heroku logs I get the following error I've read all the Heroku Rails 6 Webpacker issues, and tried all the suggestions. Nothing worked. I have commented out <%= stylesheet_pack_tag %> ... didn't help I have toggled extract_css: true in webpacker.yml file .... didn't help I have run

Rails 6 and Tailwind CSS does not deploy to Heroku

爱⌒轻易说出口 提交于 2020-04-13 17:09:21
问题 I have a Rails 6 app that was successfully deployed to Heroku and worked on localhost:3000. I added tailwindcss via yarn and webpack. It runs perfectly fine on localhost, but does not run on heroku. When I run heroku logs I get the following error I've read all the Heroku Rails 6 Webpacker issues, and tried all the suggestions. Nothing worked. I have commented out <%= stylesheet_pack_tag %> ... didn't help I have toggled extract_css: true in webpacker.yml file .... didn't help I have run