Permalink
Browse files

Initial Commit

  • Loading branch information...
0 parents commit 86c7c21b84490f5fd025972feae9d262436d1378 @atljeremy committed Jan 21, 2012
@@ -0,0 +1 @@
+.DS_Store
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="0.1">
+<dict>
+ <key>CFBundleIdentifier</key>
+ <string>SEEMode.Stylus</string> <!-- Change bundle identifier. Must start with "SEEMode." -->
+ <key>CFBundleName</key>
+ <string>Stylus</string> <!-- Change bundle name. -->
+ <key>CFBundleShortVersionString</key>
+ <string>0.1</string>
+ <key>CFBundleVersion</key>
+ <string>0.1</string>
+ <key>CFBundleGetInfoString</key>
+ <string>0.1, Copyright Jeremy Fox 2012</string> <!-- Change author. -->
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+</dict>
+</plist>
@@ -0,0 +1,6 @@
+these
+strings
+are added
+to the
+autocomplete
+dictionary
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Comments</key>
+ <dict>
+ <key>StartTag</key>
+ <string>//</string>
+ </dict>
+</dict>
+</plist>
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<settings>
+ <template>template.styl</template> <!-- Provide a template for File->new -->
+ <recognition>
+ <extension>styl</extension> <!-- Add file extensions -->
+ <extension casesensitive="no">styl</extension> <!-- Add case sensitive file extensions -->
+ <filename>StylusFile</filename>
+ </recognition>
+</settings>
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<symbols>
+
+ <blocks>
+ <beginregex>{</beginregex>
+ <endregex>}</endregex>
+ </blocks>
+
+ <symbol id="Classes" image="SymbolC" indentation="0" ignoreblocks="yes">
+ <regex>/\.[\w'-]+/g</regex>
+ </symbol>
+
+ <symbol id="Ids" image="SymbolC" indentation="0" ignoreblocks="yes">
+ <regex>/\#[\w'-]+/g</regex>
+ </symbol>
+
+ <symbol id="Functions" image="SymbolF()" indentation="1" ignoreblocks="yes">
+ <regex>(?&lt;=[\n\r]|^)[ \t]*(@*[\w\d_\$]+)[ \t]*[: =][ \t]*\(?[\w\d\s,]*\)?[ \t]+[-=]></regex>
+ </symbol>
+
+ <!-- STUDIO -->
+ <symbol id="Pragma marks" font-weight="normal" font-style="normal" image="SymbolMark" indentation="0" ignoreblocks="no" show-in-comments="yes">
+ <regex>// !([^\n\r]+)</regex>
+ </symbol>
+
+</symbols>
Oops, something went wrong.
@@ -0,0 +1,146 @@
+// color manipulation
+
+body
+ color darken(#eee, 50)
+ color darken(#eee, 50%)
+ color #eee - rgba(100,0,0,0.5)
+ color rgba(#eee,.5)
+
+// expression node access
+
+body
+ list = (one 1) (two 2) (three 3)
+ foo last(list)
+
+// pseudo hashes
+
+get(hash, key)
+ return pair[1] if pair[0] == key for pair in hash
+
+body
+ hash = (one 1) (two 2) (three 3)
+ foo get(hash, two)
+ foo get(hash, one)
+ foo get(hash, none) == null
+ foo length(hash)
+
+// color components
+
+body
+ foo red(#c00)
+ foo lightness(#c00)
+
+// units
+
+body
+ foo unit(15%)
+ foo unit(15%, px)
+ foo unit(15px, '%')
+
+// math
+
+body
+ foo abs(-5)
+ foo sum(1 2 3 4)
+ foo avg(1 2 3 4)
+
+// literals
+
+body
+ foo unquote('X::MessedUp::IE.crap(here)')
+
+// inspection
+
+p(1 + 5 / 10)
+
+// replace str with val
+
+replace(expr, str, val)
+ expr = clone(expr)
+ for e, i in expr
+ if str == e
+ expr[i] = val
+ expr
+
+// normalize gradient point (webkit)
+
+grad-point(pos)
+ if length(pos) == 1
+ return left pos if pos in (top bottom)
+ return pos top if pos in (left right)
+ else if pos[0] in (top bottom)
+ pos[1] pos[0]
+ else
+ pos
+
+// implicit color stop position
+
+pos-in-stops(i, stops)
+ len = length(stops)
+ if len - 1 == i
+ 100%
+ else if i
+ unit(i / len * 100, '%')
+ else
+ 0%
+
+// normalize color stops
+// - (color pos) -> (pos color)
+// - (color) -> (implied-pos color)
+
+normalize-stops(stops)
+ stops = clone(stops)
+ for stop, i in stops
+ if length(stop) == 1
+ color = stop[0]
+ stop[0] = pos-in-stops(i, stops)
+ stop[1] = color
+ else if typeof(stop[1]) == 'unit'
+ pos = stop[1]
+ stop[1] = stop[0]
+ stop[0] = pos
+ stops
+
+// join color stops with the given translation function
+
+join-stops(stops, translate)
+ str = ''
+ len = length(stops)
+ for stop, i in stops
+ str += ', ' if i
+ pos = stop[0]
+ color = stop[1]
+ str += translate(color, pos)
+ unquote(str)
+
+// webkit translation function
+
+webkit-stop(color, pos)
+ s('color-stop(%d, %s)', pos / 100, color)
+
+// mozilla translation function
+
+moz-stop(color, pos)
+ s('%s %s', color, pos)
+
+// create a linear gradient with the given start
+// position, followed by color stops
+
+linear-gradient(start, stops...)
+ error('color stops required') unless length(stops)
+ prop = current-property[0]
+ val = current-property[1]
+ stops = normalize-stops(stops)
+
+ // webkit
+ end = grad-point(opposite-position(start))
+ webkit = s('-webkit-gradient(linear, %s, %s, %s)', grad-point(start), end, join-stops(stops, webkit-stop))
+ add-property(prop, replace(val, '__CALL__', webkit))
+
+ // moz
+ stops = join-stops(stops, moz-stop)
+ moz = s('-moz-linear-gradient(%s, %s)', start, stops)
+ add-property(prop, replace(val, '__CALL__', moz))
+
+ // literal
+ s('linear-gradient(%s, %s)', start, stops)
@@ -0,0 +1,17 @@
+Read me
+=======
+
+This is a Coda/SubEthaEdit syntax coloring mode for the Stylus language.
+
+
+Installation
+============
+
+- Download and unpack either the ZIP or TAR version of the Styuls mode.
+- Rename the unzipped directory to 'Stylus.mode'.
+- Coda:
+ Manually copy the Styuls.mode directory into ~/Library/Application\ Support/Coda/Modes/.
+- SubEthaEdit:
+ Open the Stylus.mode file from within SubEthaEdit using the File > Open command
+ or by dragging the Stylus.mode file onto the SubEthaEdit application icon in the dock.
+

0 comments on commit 86c7c21

Please sign in to comment.