css
Version, currently 0.5.07 versions
github.com/sbsoftware/css.cr
Create CSS stylesheets in pure Crystal
3 stars
2 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
css:
github: sbsoftware/css.cr
version: ~> 0.5.0Then run:
shards installshard.yml
- Crystal
>= 1.15.1- License
- MIT
- Author
- Stefan Bilharz
Dependencies
This version declares no dependencies.
README
css.cr
Create CSS stylesheets in pure Crystal.
Installation
-
Add the dependency to your
shard.yml:dependencies: css: github: sbsoftware/css.cr -
Run
shards install.
Quick Start
require "css"
class Style < CSS::Stylesheet
rule div do
display :block
padding 12.px
end
end
puts Style
Output:
div {
display: block;
padding: 12px;
}
Documentation
Task-focused guides live in docs/:
- Getting Started
- Selectors
- Nesting
- Media Queries
- Units and calc()
- Gradients and Colors
- Fonts and @font-face
- Using !important
- Examples Gallery (copy/paste-ready DSL + rendered CSS)
- Cookbook (idiomatic patterns + CSS <-> Crystal hints)
- API Reference Summary
- Contributor Guide: Adding Properties and Enums
Coverage Index
Generate the MDN-vs-shard coverage index:
crystal scripts/generate_coverage.cr
The generated report is committed at COVERAGE.md and includes:
- supported/unsupported/missing MDN property coverage,
- typed enum coverage for enum-applicable properties,
- unsupported string-only properties,
- a checklist for adding missing CSS.
Contributing
Use the contributor docs in docs/contributing-properties-and-enums.md for implementation details.
- Fork it (https://github.com/sbsoftware/css.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Stefan Bilharz - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.5.0- Tagged
- Jun 27, 2026
- Commit
99cac416abb8- Crystal
>= 1.15.1- Indexed
- yes
Dependents
Repository
github.com/sbsoftware/css.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 16, 2026
- Synced
- Aug 16, 2026
- Versions
- 7