FichteFoll / CSScheme

Create Sublime Text or Text Mate color schemes in CSS, SCSS or stylus
MIT License
43 stars 4 forks source link
color-scheme hacktoberfest sublime-text sublime-text-package

CSScheme - Sublime Text Plugin

Build Status

Ever thought handwriting .tmTheme files sucks? But the other options for editing color schemes are not programmatical enough? Then this is for you!

What it looks like

CSScheme is a custom CSS-like syntax that converts into the .tmTheme files we all love, but it does not end there. CSScheme (the package) can also take care of compiling SCSS, SASS or stylus into CSScheme (the syntax) and then into a color scheme using all features of these pre-compilers, such as variables, conditionals or functions.

Check the example files for what's possible!

Installation

Use Package Control to install "CSScheme".

Usage (Please Read!)

You can either create a new file with the CSScheme: Create new *Scheme file commands, open a file with the .csscheme, .scsscheme, .sasscheme or .styluscheme extension or convert an existing tmTheme file using the CSScheme: Convert to CSScheme command or build system. Conversion to other syntaxes is not supported at the moment and likely won't in the future. Please convert manually and to your own preferences.

Building (ctrl+b or ⌘b) will convert the file to CSScheme, if necessary, and then into a .tmTheme file. Errors during conversion are captured in an output panel. For automation purposes, the command is named convert_csscheme.

Things you must consider when using CSScheme:

Things you must consider additionally when using CSScheme with SCSS or SASS:

Things you must consider additionally when using CSScheme with stylus:

Supported Syntaxes

CSScheme (the package) provides native support for CSScheme-to-.tmTheme conversion. Thus, all languages that compile to CSS will also work in one way or another. SCSS/SASS and stylus are automatically built from within Sublime Text, and SCSScheme even has its own syntax definition because the one from the SCSS package highlights unknown properties as invalid. Furthermore they provide snippets and completions.

If you want to use something a different pre-processor, you can do so by converting to CSScheme externally and then do conversion from CSScheme to tmTheme from within Sublime Text. Feel free to file an issue (if there isn't one already) if you'd like built-in support for an additional pre-processor.

Utility for Scheme Creation

(only CSScheme and SCSScheme)

Symbol List

Just press ctrl+r (⌘r).

In StyluScheme this is somewhat supported but since scope names are not regular html tags they don't get recognized (since I didn't bother to write a new syntax definition for stylus as well).

Snippets

only SCSScheme:

Completions

All known properties are completed as well as the basic scopes from the Text Mate scope naming conventions when specifying a selector.

Useful Resources

Here is a bunch of links that might help you when working on your color scheme.

Example Files

I prepared two example files that are merely a proof of concept and show a few of the features that are supported. The colors itself don't make much sense and are not good on the eyes because I picked them pretty much randomly, but it gives some great insight on what is possible.

If you would like to see a real world example, refer to the Writerly Scheme by @alehandrof which heavily uses SASS's @import to make a larger scheme more manageable.

Other Efforts for Easing Color Scheme Creation

Please note that all these work directly on .tmTheme files.