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

Add tests for CSS validation #19

Closed
fulldecent opened this issue Mar 20, 2017 · 12 comments
Closed

Add tests for CSS validation #19

fulldecent opened this issue Mar 20, 2017 · 12 comments

Comments

@fulldecent
Copy link
Owner

Discussion

There is probably already a tool for this we can use.

@ilyalyo
Copy link
Contributor

ilyalyo commented Apr 4, 2017

If we will use npm, we can use this tool: CSSLint
Also, purifycss is a very nice tool, may be you would like to use it too, it analyze all css and html/php files and check which selectors are used, than it can generate 1 optimized css file.

@fulldecent
Copy link
Owner Author

Not interested in purify because that is a build tool, we only want validation tools now. Let's use CSSLint. Have you checked for a Ruby wrapper?

@ilyalyo
Copy link
Contributor

ilyalyo commented Apr 7, 2017

I found one wrapper, but it's not maintained more than 5 years, I think it's not a problem becouse we can run it with sh like this:

desc "Validate css files under css folder"
task :css_lint do
  unless system('which csslint')
   puts "csslint is not installed\nrun npm install -g csslint"
   exit(1)
  end
  sh "csslint #{@build_dir}css/*.css"
end

@fulldecent
Copy link
Owner Author

Let's wait until we find a more robust solution.

run npm install -g csslint

is too manual. I really do not want to add install steps for the end user.

@ilyalyo
Copy link
Contributor

ilyalyo commented May 14, 2017

What about this one: https://github.com/w3c-validators/w3c_validators
It can validate css and it's pretty active, last commit was last month.

@fulldecent
Copy link
Owner Author

Yes, that looks good!

@ilyalyo
Copy link
Contributor

ilyalyo commented May 16, 2017

Just a note: In this library we can validate either string (css) or css file, we can not validate css inside html file without extracting it.
I think we can add this as htmlproofer extension, what do you think?

@fulldecent
Copy link
Owner Author

That is an interesting idea, but not in scope for now.

@ilyalyo
Copy link
Contributor

ilyalyo commented May 17, 2017

You want to implement directly in lighting sites?
I think it easier with htmlproofer.
Or it should be stand alone gem.

@fulldecent
Copy link
Owner Author

Right now we just want to validate .css files using an off-the-shelf library. We do not want to validate css inside html files.

@ilyalyo
Copy link
Contributor

ilyalyo commented May 18, 2017

Added PR: fulldecent/lightning-sites#20

@fulldecent
Copy link
Owner Author

Fixed in #20 and released in fa757fe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants