Skip to content
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

Unclear error message with :first-child and :last-child #3118

Open
rim-odoo opened this issue Jul 16, 2020 · 0 comments
Open

Unclear error message with :first-child and :last-child #3118

rim-odoo opened this issue Jul 16, 2020 · 0 comments

Comments

@rim-odoo
Copy link

Hello

I found a weird behaviour when attempting to fix https://github.com/odoo/enterprise/pull/11881

input.scss

This CSS is deliberately WRONG.

div {
    ul:first-child() {
        font-family: Arial;
    }
}

(can also be tested with :last-child())

Actual results

libsass 3.6.4
python-libsass 0.19.4

pysassc: error: Error: Custom property values may not be empty.
        on line 2:8 of test.scss
>>     ul:first-child() {

   -------^

Expected result

I know that my CSS is wrong (in older versions, it would have failed silently. It is good that the compiler now fails on broken CSS).

➡️ the error message that is thrown mentions "custom property values"
➡️ :first-child and :last-child are not "custom properties" as far as I know

I did some research and found this: #2882

Wouldn't the error message be a side-effect of that change? Shouldn't it be changed to be more explicit and return something like "Invalid CSS" ?

Thanks for your comments, I'm available if you need any other info

xmo-odoo added a commit to odoo-dev/odoo that referenced this issue Apr 7, 2021
In recent versions of libsass, this triggers an error "Custom property
values may not be empty" (sass/libsass#3118) which breaks pages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants