Once you visit a .lass
file, it will automatically start in the LASS
major-mode, which is a derived-mode from COMMON-LISP-MODE
. Whenever you save, it will automatically try to compile the lass file to its CSS equivalent. If slime is connected, it will try to quickload LASS and evaluate GENERATE
. If slime is not connected, it instead executes a shell command. In order for that to work, the lass
binary must be in your path.
If your operating system is not directly supported with a binary, you can build it yourself using a build tool like Buildapp, the ASDF system BINARY-LASS
and the entry-point BINARY-LASS:CMD-WRAPPER
.
ASDF Integration
+ +If you want to compile LASS files to CSS in your systems, you can now (v0.4+) do this via a lass-file
component type, and :defsystem-depends-on
-ing LASS.
(asdf:defsystem my-system
+ :defsystem-depends-on (:lass)
+ :components ((:lass-file "test-file")))
+
+You can also specify an :output
argument to a lass-file
to specify what the target css file should be.
Package Index
@@ -227,6 +238,32 @@ article p a:hover, article blockquote a:hover{ (ORG.TYMOONNEXT.LASS)-
+
+
+ ++ ACCESSOR + ++
+PROPERTY-FUNCTION
+ + (NAME) +Returns a function to process a property function of NAME, if any.
+ -
+
+
+ ++ CLASS + ++
+LASS-FILE
+ + +An ASDF source-file component to allow compilation of LASS to CSS in ASDF systems.
+ -
@@ -262,8 +299,8 @@ together into one list of blocks and properties. GENERATE
- (IN &KEY (OUT (MERGE-PATHNAMES (MAKE-PATHNAME TYPE css) IN)) (PRETTY NIL) - (IF-EXISTS SUPERSEDE)) + (IN &KEY (OUT (MERGE-PATHNAMES (MAKE-PATHNAME :TYPE "css") IN)) (PRETTY NIL) + (IF-EXISTS :SUPERSEDE))Generate a CSS file from a LASS file. @@ -314,6 +351,32 @@ Returns OUT
Creates a property object with PROPERTY as its key and VALUE as its value.
-
+
+
+ ++ FUNCTION + ++
+REMOVE-PROPERTY-FUNCTION
+ + (NAME) +Removes the property function NAME.
+ -
+
+
+ + FUNCTION + ++
+RESOLVE-FUNCTION
+ + (FUNCTION &REST ARGS) +Turns the FUNCTION with its ARGS into a properly usable property value.
+ -
@@ -462,6 +525,34 @@ Calls COMPILE-CONSTRAINT with the SELECTOR's CAR and CDR. (T) Returns a list with the RESOLVEd SELECTOR. + -
+
+
+ + GENERIC + ++
+CONSUME-ITEM
+ + (ITEM READABLE-LIST) +Consumes items from READABLE-LIST as required by the ITEM. +Returned should be two values, the first being a property to compile (or NIL) +and the second a block to compile (or NIL). +By default, the following cases are handled: + + (LIST) +Simply returns the ITEM as a block. + + (SYMBOL) +If it's a keyword, reads until the next keyword or list and returns that as a +property to compile. With property-functions, some sublists may also be read +in automatically. See DEFINE-PROPERTY-FUNCTION. If it is a regular symbol, +CALL-NEXT-METHOD is invoked. + + (T) +Signals an error.
+ -
@@ -476,12 +567,13 @@ Returns a list with the RESOLVEd SELECTOR. Resolves THING to a value that makes sense for LASS. By default the following types are handled: -NULL: NIL -STRING: the THING itself -ARRAY: the variable stored in *VARS* under THING -KEYWORD: Colon-prefixed, downcased symbol-name of THING -SYMBOL: Downcased symbol-name of THING -T: PRINC-TO-STRING of THING
+NULL: NIL +STRING: the THING itself +ARRAY: the variable stored in *VARS* under THING +KEYWORD: Colon-prefixed, downcased symbol-name of THING +SYMBOL: Downcased symbol-name of THING +PATHNAME: If designating an image, base64 encoded inline image data. +T: PRINC-TO-STRING of THING - @@ -533,6 +625,105 @@ You can define special handling of the browsers by defining options specifically for them. If no handling is defined, the DEFAULT option is used as a fallback.
+ DEFINE-PRIMITIVE-PROPERTY-CONSUMER
+
+ (SPECIALIZER (PROPVALS READABLE NEXT) &BODY LOOP-BODY)
+
+ Defines a CONSUME-ITEM method for the given item SPECIALIZER. + +SPECIALIZER --- The method specializer for the item. +PROPVALS --- The list that should contain the property values. +READABLE --- The readable-list being operated on currently. +NEXT --- Bound to the next (unconsumed) item in the readable-list. +LOOP-BODY --- The body of the reading loop to execute until the readable is empty. + +The return value of the loop-body is discarded. You can use (RETURN) to exit the loop, +for example for when you encounter an item you don't want to read.+
+ DEFINE-PROPERTY-FUNCTION
+
+ (NAME ARGS &BODY BODY)
+
+ Define a new property function NAME, accepting ARGS. +The body should return a value to use directly, if possible a string. +The results of a property-function should not be RESOVLEd. + +Property functions are function calls that occur as (part of) the +value of a property. Due to ambiguity issues with a general sub-block, +property functions need to be explicitly defined and may completely +differ depending on the property. Property functions defined with this +are only the defaults available for all properties. If you want to +minimise collision probability or avoid an illegal function for a +certain property, you should define a direct method on CONSUME-ITEM +to handle the reading of the property values manually.+
+ DEFINE-PROPERTY-FUNCTION-CASE
+
+ (PROPERTY (ARGS) &BODY FUNCTION-CLAUSES)
+
+ Defines a CONSUME-ITEM method for PROPERTY that has special handling for property-functions. + +FUNCTION-CLAUSES ::= function-clause* +FUNCTION-CLAUSE ::= (function-name form*) + +Each function-name is compared by STRING-EQUAL and each clause should return the +property-value to use in its place, or NIL if it should be skipped. + +You can use (RETURN) in a clause body to stop reading values altogether.+
+ DEFINE-SIMPLE-PROPERTY-FUNCTION
+
+ (NAME ARGS)
+
+ Defines a property function that returns name(arg1,arg2...). +Only required arguments are allowed.+
+ DEFINE-SIMPLE-PROPERTY-FUNCTIONS
+
+ (PROPERTY &REST FUNCSPECS)
+
+ Defines a CONSUME-ITEM method for PROPERTY that has special handling for property-functions. + +FUNCSPECS ::= funcspec* +FUNCSPEC ::= (funcname arg* [&optional arg*] [&key arg*]) + +See DEFINE-PROPERTY-FUNCTION-CASE.+