Home Download Buy Blog Forum Support

CSScheme - Create Color Schemes using CSS, SCSS or styus

CSScheme - Create Color Schemes using CSS, SCSS or styus

Postby FichteFoll on Sat Feb 22, 2014 6:19 pm

https://github.com/FichteFoll/CSScheme (available from Package Control)

Inspired by viewtopic.php?f=4&t=7597&p=32393#p32393 (yeah, long ago) I was suddenly really motivated to write this, and this is what came out of that.

It parses a slightly modified CSS syntax to support the complete syntax of tmTheme files, or at least everything I know about. You use arbitrary @at-rules to specify things such as the scope name or comments normal properties are added to the "settings" dictionary. There is some magic involved that checks for valid input, but not everything is checked. More information in the readme.

Since it parses CSS you can basically use any other CSS-like language that compiles it. I decided to use SCSS as the main target here, but SASS and stylus are supported too. Leave an issue on the repo if you'd like to see another language supported (such as LESS).

Most of the features can be seen in my example file (colors might cause cancer, I selected them randomly), so I recommend checking that out.

Finally, have an animated screenshot:

Image
Last edited by FichteFoll on Thu Aug 28, 2014 3:19 am, edited 2 times in total.
FichteFoll
 
Posts: 408
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: CSScheme - Create Color Schemes using CSS or SCSS

Postby quodlibet on Sun Feb 23, 2014 12:16 pm

-Wow. I haven't had a chance to check the ST forums in weeks. I only decided to pop in today and see if I could help out because I have a deadline looming (so _of course_ I am procrastinating). And... _this_!

I haven't checked it, yet, because I can hear the whoosh of that deadline. But I'll definately be checking this out soon :)

Thanks FichteFoll!

P.S. I see you've also updated InsertDate. I should really pay more attention... :)
quodlibet
 
Posts: 561
Joined: Sat Jun 18, 2011 5:53 pm

Re: CSScheme - Create Color Schemes using CSS or SCSS

Postby facelessuser on Sun Feb 23, 2014 5:55 pm

Interesting.
facelessuser
 
Posts: 1576
Joined: Tue Apr 05, 2011 7:38 pm

Re: CSScheme - Create Color Schemes using CSS or SCSS

Postby aziz on Mon Feb 24, 2014 8:51 am

Really Cool!
PlainTasks: my opinionated todo plugin
tmThemeEditor color-scheme editor for SumblimeText and Textmate (code on github)
aziz
 
Posts: 40
Joined: Thu Jan 12, 2012 6:29 pm

Re: CSScheme - Create Color Schemes using CSS or SCSS

Postby quodlibet on Mon Feb 24, 2014 5:53 pm

@FichteFoll I am encountering some weirdness . . . either that or it's late and my mind is foggy. Do you prefer bug reports here or on github?
quodlibet
 
Posts: 561
Joined: Sat Jun 18, 2011 5:53 pm

Re: CSScheme - Create Color Schemes using CSS or SCSS

Postby quodlibet on Mon Feb 24, 2014 6:17 pm

I can't figure it out what's wrong.

Given this:

Code: Select all
@name "Test";

$hotpink: #fe57a1;

* {
   selection:       transparentize($hotpink, .85);
   selectionBorder: transparentize($hotpink, .76);
}


I get this:

Code: Select all
Traceback (most recent call last):
  File "my_sublime_lib in C:\Alex\Dropbox\Apps\Sublime Text 3\Data\Installed Packages\CSScheme.sublime-package", line 62, in run_
  File "C:\Alex\Dropbox\Apps\Sublime Text 3\sublime_plugin.py", line 526, in run_
    return self.run()
  File "csscheme in C:\Alex\Dropbox\Apps\Sublime Text 3\Data\Installed Packages\CSScheme.sublime-package", line 182, in run
  File "tinycsscheme.dumper in C:\Alex\Dropbox\Apps\Sublime Text 3\Data\Installed Packages\CSScheme.sublime-package", line 65, in dump_stylesheet_file
  File "tinycsscheme.dumper in C:\Alex\Dropbox\Apps\Sublime Text 3\Data\Installed Packages\CSScheme.sublime-package", line 114, in datafy_stylesheet
  File "tinycsscheme.dumper in C:\Alex\Dropbox\Apps\Sublime Text 3\Data\Installed Packages\CSScheme.sublime-package", line 147, in datafy_ruleset
  File "tinycsscheme.dumper in C:\Alex\Dropbox\Apps\Sublime Text 3\Data\Installed Packages\CSScheme.sublime-package", line 147, in <genexpr>
AttributeError: 'FunctionToken' object has no attribute 'value'


It's line 7 (selectionBorder) that causes the issue, but I don't understand why. It will work if I change the line to:

Code: Select all
selectionBorder: $hotpink;


Let me know if the above make sense.

Alex
quodlibet
 
Posts: 561
Joined: Sat Jun 18, 2011 5:53 pm

Re: CSScheme - Create Color Schemes using CSS or SCSS

Postby FichteFoll on Mon Feb 24, 2014 8:41 pm

I prefer bugs on github because I get notifications when a new issue is created and I check those regularly, this forum not so much but you would get an answer. (Also it's an actual issue tracker where you can "close" stuff and refer to it from commits for example.)

Anyway, I can work with this here. It seems indeed like a weird case. I don't have time to debug this today but I will look into it tomorrow.
FichteFoll
 
Posts: 408
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: CSScheme - Create Color Schemes using CSS or SCSS

Postby quodlibet on Mon Feb 24, 2014 8:51 pm

OK --> https://github.com/FichteFoll/CSScheme/issues/1

Let me know if I can help with troubleshooting the issue.

Alex
quodlibet
 
Posts: 561
Joined: Sat Jun 18, 2011 5:53 pm

Re: CSScheme - Create Color Schemes using CSS or SCSS

Postby FichteFoll on Wed Feb 26, 2014 5:14 am

Some bug fixes were pushed, including for the one reported above.

Please report any issue you find in the github issues or alternatively here if you don't have a github account.

I'm considering providing some kind of utility functions that work in the HCL color system and could do work like this https://vis4.net/blog/posts/mastering-m ... or-scales/, which looks pretty impressive and useful (tool to play with).
FichteFoll
 
Posts: 408
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: CSScheme - Create Color Schemes using CSS or SCSS

Postby quodlibet on Sat Mar 08, 2014 8:29 am

For anyone interested in playing along, I have built a color scheme in CSScheme:
https://github.com/alehandrof/Writerly

It's a port of an unreleased scheme that I've been using for a long time. It's fully functional and very pretty (if I do say so myself) although I am more interest in CSS and Markdown than C++ so it may not be everyone's cup of tea.

@FichteFoll: the color stuff you linked to are very interesting. But wouldn't make more sense to hook these on top of Sass rather than on top of CSScheme? (Not that I know anything about Sass development :) )

Alex
quodlibet
 
Posts: 561
Joined: Sat Jun 18, 2011 5:53 pm

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 5 guests