Skip to content

Repository files navigation

CSS Editor

MIT LicenseLive Demo

CSS Editor Icon

A lightweight, standalone CSS editor for quickly testing and tweaking stylesheets — right in your browser.

👉 Live Demo · ⬇️ Download


✨ Features

FeatureDescription
⚡ Live editingCSS changes apply to the preview instantly — no reload needed
🔌 100 % offlineNo server, no bundler, no Node.js. Just open index.html in your browser.
💾 Version controlSave, rename, and delete named CSS versions in localStorage
📂 File I/OLoad .css files from disk · Download your CSS anytime
🔖 Section jumpsNavigate large stylesheets via /* === Section Name === */ comments
👁️ HTML samplesTen built-in templates covering typography, lists, tables, forms, cards,
navigation, code, media, admonitions, and a full-page layout
🔄 Reset buttonRestore the default stylesheet with one click
📱 Isolated previewPreview runs in an <iframe> — your CSS never leaks into the editor UI
💾 Persistent storageYour work is saved automatically to localStorage
⚙️ Zero dependenciesA single HTML file plus a few scripts. Easy to understand, easy to extend.
🎨 Easy customizationAdd your own templates, color palettes, and snippets
🌗 Theme switchingDefault CSS uses :root variables — swap light/dark theme via snippets

Screenshot

CSS Editor Screenshot

🚀 Quick Start

  1. Download the latest release or clone the repo:

    git clone https://github.com/arakel2/css-editor.git
  2. Use it — Open index.html in your browser and start editing.

Requirements: A modern browser (Firefox, Chrome, Edge, Safari).
Works offline – no server required.

Keyboard Shortcuts

Line Operations

Windows/LinuxMacFunction
Ctrl+DCommand+DDelete current line
Alt+Shift+DownCommand+Option+DownCopy line down
Alt+Shift+UpCommand+Option+UpCopy line up
Alt+DownOption+DownMove line down
Alt+UpOption+UpMove line up

Editor Font Size

Windows/LinuxMacFunction
Ctrl+Alt++Ctrl+Alt++Increase Font-Size
Ctrl+Alt+-Ctrl+Alt+-Decrease Font-Size
Ctrl+Alt+RCtrl+Alt+RReset Font-Size

Multi-Cursor

Windows/LinuxMacFunction
Ctrl+Alt+UpCtrl+Option+UpAdd cursor above
Ctrl+Alt+DownCtrl+Option+DownAdd cursor below
Ctrl+Alt+RightCtrl+Option+RightAdd next occurrence to multi-selection
Ctrl+Alt+LeftCtrl+Option+LeftAdd previous occurrence to multi-selection

Find & Replace

Windows/LinuxMacFunction
Ctrl+FCommand+FFind
Ctrl+HCommand+Option+FReplace
Ctrl+GCommand+GFind next
Ctrl+Shift+GCommand+Shift+GFind previous

Undo / Redo / Toggle Comment

Windows/LinuxMacFunction
Ctrl+ZCommand+ZUndo
Ctrl+YCommand+YRedo
Ctrl+/ or Ctrl+#Command+/Toggle comment

⚙️ Customization

Add Your Own Samples 📋

Create a new file in the samples/ folder:

// samples/sample11.jswindow.CSS_SAMPLES=window.CSS_SAMPLES||[];window.CSS_SAMPLES.push({name: 'My Custom Sample',html: ` <h1>Hello World</h1> <p>Your HTML goes here.</p> `});

Then add the script tag in index.html (before the app script):

<scriptsrc="samples/sample11.js"></script>

Add Your Own Images 🖼️

Place images in samples/images/ and reference them in your samples with relative paths, e.g. <img src="samples/images/img01.jpg">.

Use Your Own Default CSS 💻

Edit style.js to change the stylesheet that is loaded on first run or when clicking the 🔄 Reset button.
The CSS is stored as a string in window.cssContent.

Add Your Own Color Palettes 🎨

Create a new file in the palettes/ folder:

// palettes/brand-colors.jswindow.CSS_PALETTES=window.CSS_PALETTES||[];window.CSS_PALETTES.push({name: 'Brand Colors',colors: ['#ff6900','#fcb900','#00d084','#0693e3','#9b51e0']});

Then add the script tag in index.html:

<scriptsrc="palettes/brand-colors.js"></script>

Each palette needs a name (shown as group label) and an array of colors (any valid CSS color string, e.g. hex, rgb, hsl).

Add Your Own Snippets 📝

Create a new file in the snippets/ folder:

// snippets/my-snippets.jswindow.CSS_SNIPPETS=window.CSS_SNIPPETS||[];window.CSS_SNIPPETS.push({name: 'My Snippets',items: [{label: '--brand',value: 'var(--brand-color)'},{label: 'Flex center',value: 'display: flex;\n align-items: center;'}]});

Then add the script tag in index.html:

<scriptsrc="snippets/my-snippets.js"></script>

Each item needs a label (button text) and a value (text inserted at cursor position). Use \n for line breaks in multi-line snippets.

🔗 Live Demo

The editor is hosted via GitHub Pages:

👉 https://arakel2.github.io/css-editor/

📚 Third-Party Libraries

This project includes ACE — a high-performance code editor for the web, developed by Ajax.org B.V.
ACE is licensed under the BSD License. See ace/LICENSE for details.

License

This project is licensed under the MIT License.
© 2026 by Andreas Keller (arakel2)

About

A lightweight, standalone CSS editor for quickly testing and tweaking stylesheets — right in your browser.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages