A simple bash script that creates a basic CSS file structure for Rails applications.
This is not a CSS framework. It's just a scaffold - a starting point that gives you some structure and organization so you can write your own CSS.
Copy the script to somewhere in your PATH:
cp csscaffold ~/.local/bin/
# or
sudo cp csscaffold /usr/local/bin/Run from the root of a Rails application:
csscaffoldThe script will:
- Verify you're in a Rails application directory
- Show you the files it will create
- Warn about any existing files (which will NOT be overwritten)
- Ask for confirmation before proceeding
Want to see what gets created before running it? Check out the examples/ folder to see all 11 CSS files with their full content.
| File | Purpose |
|---|---|
_global.css |
Global variables (spacing, text, borders, shadows, etc.) |
colors.css |
Color system and palette |
base.css |
Base element styles |
buttons.css |
Button styles |
dialog.css |
Modal/dialog styles |
flash.css |
Rails flash messages |
inputs.css |
Form inputs |
layout.css |
Page layout |
nav.css |
Navigation |
reset.css |
CSS reset |
utilities.css |
Utility classes |
- A
reset.csswith a modern CSS reset based on Fizzy's reset - A
colors.csstemplate showing how to organize your color system @layerdeclarations for CSS cascade control- Commented-out examples following fizzy's patterns
- A sensible file organization to build on
The rest is up to you.
csscaffold is intentionally minimal - it provides structure and a reset, but no pre-built components or utilities.
If you want something more comprehensive:
-
css-zero - Pre-built CSS utilities and components for Rails, distributed as a gem. Good if you want a "no-build" CSS framework with conventions.
-
Tailwind CSS - Utility-first CSS framework. Good if you want extensive utilities and don't mind the build step.
-
Pico CSS - Classless CSS framework. Good if you want minimal pre-built styles for basic HTML elements.
-
Water.css - Just add one
<link>tag. Good if you want instant styling with zero setup.
csscaffold is for you if:
- You want structure without conventions
- You prefer writing your own CSS rather than using utilities
- You want a minimal reset and file organization to build on