question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with @import with tailwindcss JIT and laravel

See original GitHub issue

Hi, I’m using tailwidcss JIT and laravel with laravel mix. I’ve a problem with css variables. I’ve three files: app.css, _variables.css and global.css. If I import the _variables.css file in global.css or in app.css it compiles correctly in app.min.css but I can’t see any changes related to css variables in browse. Instead if I put all the rules in one file, it works. I can’t figure why. Can you help me? Below my files:

app.css

@import "tailwindcss/base";
@import "tailwindcss/utilities";
@import "tailwindcss/components";

@import "partials/_variables.css";
@import "partials/_global.css";

_variables.css

:root {
    /* Font family */
    --main-font-family: "'Inter', sans-serif";

    /* Width */
    --max-width-content: "100rem";

    /* Colors */
    --color-primary: #006633;
    --color-secondary: #FF7700;
}

_global.css

html {
    @apply h-full font-base;
}

body {
    @apply min-h-full font-base antialiased bg-primary;
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
RyanZimcommented, May 29, 2021

As per the docs:

This plugin attempts to follow the CSS @import spec; @import statements must precede all other statements (besides @charset).

0reactions
giuliac89commented, May 30, 2021

Quite right, thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Laravel Mix 6.0.25 not building with @tailwindcss/jit
You're using the PostCSS plugin, yet you are attempting to compile SASS. Do it the following way instead. .postCss('resources/css/app.css', ...
Read more >
Possible to run with Laravel Mix? #24 - GitHub
Super pumped to try Tailwind JIT. I'm having trouble adding it to a Statamic project using Laravel Mix to configure PostCSS, ...
Read more >
Install Tailwind CSS with Laravel
Start by creating a new Laravel project if you don't have one set up already. The most common approach is to use the...
Read more >
Using Tailwind's JIT compiler with Laravel Mix - Michael Dyrynda
First, install the JIT-compiler with NPM. 1npm install -D @tailwindcss/jit tailwindcss postcss. Next, ensure that your tailwind.
Read more >
Error in running "npm run dev" - Laracasts
laravel -mix: github:JeffreyWay/laravel-mix#master; tailwind-css: ^2.0.4 ... at /var/www/html/work/node_modules/@tailwindcss/jit/src/index.js:50:11 at ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found