Skip to content

ahmadchata/Linter_CSS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby Capstone (CSS Linter)

View Code Github Issues GitHub Pull Requests View Code Twitter Follow LinkedIn follow

Content

About   |    Rules   |    Installing   |    Setup   |    Built with   |    Using Linter   |    Testing   |    Author

About

This project is a CSS Linter, It checks for errors in CSS files

Rules

The Style rules created are listed below:

Space before opening brace

  • Checks if there's a space before the opening brace

good

.test {
   background: blue;
}

bad

.test{
   background: blue;
}

Block Indentation

  • Checks if there's 2 spaces indentation in a block

good

.test {
   background: blue;
}

bad

.test {
background: blue;
}

Lower case for hex colors

  • Checks if the hex code is in lower case

good

.test {
   background: #fff;
}

bad

.test {
   background: #FFF;
}

Empty Block

  • Checks if the block is empty

good

.test {
   background: blue;
}

bad

.test {
}

No unit for Zero

  • Checks if there's no unit for 0 value

good

.test {
   background: blue;
   padding: 0;
}

bad

.test {
   background: blue;
   padding: 0px;
}

📸 Screenshot

  • Screenshot

📹 Video description

🔧 Built with

  • Ruby
  • RSpec (Testing)

🔨 Setup

  • Fork the repo to your remote repository.
  • Clone or download the repository to a local directory on your computer.

🛠 Installing

  • Ruby must be installed on machine.
  • run bundle install to install the dependencies for the project

🛠 Using the linter

  • cd into the project directory
  • run bin/main.rb <target_file>
  • Example is bin/main.rb css/error.css to check the error.css file

🛠 Testing

  • cd into the project directory
  • To test run rspec or bundle exec rspec

✒️ Author

👤 Ahmad Chata

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the issues page.

👍 Show your support

Give a ⭐️ if you like this project!

👏 Acknowledgements

  • Microverse.

About

💻‼️A Command-line based app that checks for errors in CSS files such as 2 spaces indentation in blocks, space before opening brace, lower case for hex colour code.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors