-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Freshly generated app contains syntax errors in home.css
#5546
Comments
Does the browser complain about this file? It is a throwaway file for styling on the "welcome to phoenix" page and nothing else. I'm happy to address this if it's a real problem, but again this isn't supposed to be a file that you really customize so a css linter complaining really isn't an issue imo. If the browsers errors then we should definitely address it. Thanks! |
Browsers have no problems ignoring a single line of broken CSS, so it doesn't break anything in terms of rendering. Still, I think it should be fixed if a fix is easily achievable because it might be mistaken by beginners as something they did wrong (because IDEs tend to mark those invalid files in red). I'm also of the opinion that the default generated app, even though it's meant to be thrown away, is a sort of showcase of the framework, so it should still be of high quality, right? |
Yes please send a PR if this is an easy fix. Note that this only applies when you run the |
Hi! I was looking at the commit history while updating the Investigating further, turns out the empty properties are by design, see:
Removing the empty properties can have unintended effects:
The spec seems to agree with that odd-looking empty property syntax:
So I think the buggy part is the IDE linter? In any case, I also noticed that a fresh new Phoenix app with Tailwind support generates those same "empty properties" in |
Environment
1.15.0
phx_new-1.7.7
Actual behavior
After generating a fresh Phoenix app (exact command:
mix phx.new phoenix_app --no-dashboard --no-ecto --no-gettext --no-mailer --no-tailwind
), I noticed that my IDE is unhappy about thehome.css
file (lots of red squiggles). I passed the file though the CSS validator. It contains roughly 50 identical syntax errors, all custom CSS properties without any value given like this:Expected behavior
A freshly generated app has no syntax errors in any of its files.
Can I open a PR that will remove those properties without values, or is that going to break something in Tailwind (whose custom properties those are, I assume)?
I know this is a low priority problem because browsers are extremely forgiving about CSS syntax errors and the file is meant to be deleted, but I still think it's worth fixing because red squiggles in a fresh project might make newcomers to the framework think that they did something wrong.
The text was updated successfully, but these errors were encountered: