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

CSS variables not supported #17

Closed
scottaddie opened this issue Dec 31, 2016 · 11 comments
Closed

CSS variables not supported #17

scottaddie opened this issue Dec 31, 2016 · 11 comments

Comments

@scottaddie
Copy link

CSS variables don't seem to be supported. For example, try minifying a CSS file with the following content:

:root {
--background:#006b6b;
--textcolour:#ffffff;
--hoverOverColour:#FFC100;
--gradientDarkColour:#004a4a;
--gradienDarkHoverColour:#005a5a;
--gradientLightColour:#008b8b;
--gradientLightHoverColour:#009b9b;
--topMenuTextColour:#003b3b;
}

The following error occurs for each of the 8 variables defined above: Expected semicolon or closing curly-brace, found '-'. I'm using version 1.5.1 of the NuGet package when I encounter this error.

@xoofx
Copy link
Collaborator

xoofx commented Jan 2, 2017

Probably not handled by the original parser. PR are welcome!

@mm98
Copy link

mm98 commented Dec 9, 2017

Wouldn't this "just" need an extra check (for dash) here and maybe an updated Resource text?

@nickalbrecht
Copy link

As a heads up, Bootstrap 4 just hit release milestone which makes use of CSS variables. So this will likely be reported more and more frequently as time goes on.

@xoofx
Copy link
Collaborator

xoofx commented Jan 20, 2018

As a gentle reminder, if you want this to be fixed, I highly encourage a contributor to step-in and contribute to fix this issue. I'm willing to help/merge/review a PR but can't afford/provide more development support for this project on my spare-time.

@DerAlbertCom
Copy link

DerAlbertCom commented Jan 24, 2018

I started with a PR, but i am in tooling Hell. Because it's used project.json and other stuff. Are you ok with updating this to VS 2017?

@omarmallat
Copy link

I wish someone contribute and solve it. it's really important.

@xoofx
Copy link
Collaborator

xoofx commented Jan 25, 2018

I started with a PR, but i am in tooling Hell. Because it's used project.json and other stuff. Are you ok with updating this to VS 2017?

The project is already compatible with VS2017 (and running on appveyor with it). NUglify project itself is not using project.json but the new csproj format. Only the tests are using project.json, because at that time, having tests running fine with NUnit, new csproj format and ReSharper was not possible. So not sure what is happening on your side, but it should work.

@rockstardev
Copy link
Contributor

@DerAlbertCom you managed to fix this? Is this where you are working: https://github.com/DerAlbertCom/NUglify/commits/master ?

@DerAlbertCom
Copy link

@lepipele no, forgot about this ;) I tried, but getting it not compiled without problems.

@rockstardev
Copy link
Contributor

@DerAlbertCom your problem is likely the way @xoofx embedded submodule for HTML test data: https://github.com/xoofx/tidy-html5-tests/tree/a510b5439ea35a3f92f89c19dd4ed6813b00f966

Anyways, I got it compiled and will see to write a test that passes for bootstrap4 as @scottaddie described. Shouldn't take too long and will keep everyone updated.

@xoofx what I will change is likely somewhere around here: https://github.com/xoofx/NUglify/blob/a25841702f2008f5f0670ee9b3998636ef1e36db/src/NUglify/Css/CssParser.cs#L1509

I am still looking at how you are parsing browser specific prefixes, because this should be similar... only with extra dash. Hopefully once this is resolved we can update Minifier: madskristensen/BundlerMinifier#218

@rockstardev
Copy link
Contributor

@scottaddie this has been merged and NuGet published by @xoofx:

https://www.nuget.org/packages/NUglify/1.5.10

Can you close this now?

@xoofx xoofx closed this as completed Apr 5, 2018
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

7 participants