Closed Flying-Toast closed 1 year ago
What does it exit with? Can you provide more information? Thanks!
Oops, accidentally pressed ctrl-enter, didn't mean to post the issue yet :-)
@chrismccord finished writing it now :)
@apply
requires the postcss plugin, which is not shipped with the standalone package. You can opt-in to using node/npm or use this elixir library without @apply
. Thanks!
Ah, thank you!
@chrismccord Actually, it seems as though live reloading doesn't work at all with tailwind 3.2.1 - if I add a class to an element in one of my templates normally (<p class="text-red-500">abc</p>
), I can't get it to be reflected in the browser. With 3.1.6, changes are shown in the browser and live reload works.
Steps to reproduce:
mix phx.new foobar --no-ecto --no-gettext --no-dashboard --no-live --no-mailer
config :tailwind, version: "3.2.1", default: [ ......]
mix phx.server
and open your app in browser.app.css
, add the following (below the generated@tailwind
directives:Notice that the live reloading works and your changes are reflected in the browser. You can change this css and live reload will continue to work.
You will see the following printed in the console:
CssSyntaxError: tailwindcss: /home/simon/workspace/den_dash/assets/css/app.css:6:2: The
not-a-real-class
class does not exist. Ifnot-a-real-class
is a custom class, make sure it is defined within a@layer
directive. at Input.error (/snapshot/tailwindcss/node_modules/postcss/lib/input.js:148:16) at AtRule.error (/snapshot/tailwindcss/node_modules/postcss/lib/node.js:60:32) at processApply (/snapshot/tailwindcss/lib/lib/expandApplyAtRules.js:357:29) at /snapshot/tailwindcss/lib/lib/expandApplyAtRules.js:505:9 at /snapshot/tailwindcss/lib/processTailwindFeatures.js:55:50 at Object.Once (/snapshot/tailwindcss/lib/cli/build/plugin.js:251:19) at LazyResult.runOnRoot (/snapshot/tailwindcss/node_modules/postcss/lib/lazy-result.js:337:23) at LazyResult.runAsync (/snapshot/tailwindcss/node_modules/postcss/lib/lazy-result.js:393:26) { reason: 'Thenot-a-real-class
class does not exist. Ifnot-a-real-class
is a custom class, make sure it is defined within a@layer
directive.', file: '/home/simon/workspace/den_dash/assets/css/app.css', source: '@import "tailwindcss/base";\n' + '@import "tailwindcss/components";\n' + '@import "tailwindcss/utilities";\n' + '\n' + 'a {\n' + '\t@apply not-a-real-class;\n' + '}\n', line: 6, column: 2, endLine: 6, endColumn: 26, input: { line: 6, column: 2, endLine: 6, endColumn: 26, source: '@import "tailwindcss/base";\n' + '@import "tailwindcss/components";\n' + '@import "tailwindcss/utilities";\n' + '\n' + 'a {\n' + '\t@apply not-a-real-class;\n' + '}\n', url: 'file:///home/simon/workspace/den_dash/assets/css/app.css', file: '/home/simon/workspace/den_dash/assets/css/app.css' }, plugin: 'tailwindcss' }a { @apply text-red-500; }
Rebuilding... CssSyntaxError: tailwindcss: /home/simon/workspace/foobar/assets/css/app.css:6:2: The
not-a-real-class
class does not exist. Ifnot-a- real-class
is a custom class, make sure it is defined within a@layer
directive.4 | 5 | a {