lass

API Reference

binary-lass

System to create a binary executable for LASS.

BINARY-LASS

  • Function MAIN (&optional in out (pretty "false"))
  • Function CMD-WRAPPER (&optional args)

lass

Lisp Augmented Style Sheets. Compiles LASS to CSS.

LASS

  • Variable *VARS*
    (make-hash-table)
    Special variable containing LASS-environment variables. See the definition of the LET block.
  • Generic-Function RESOLVE (thing)
    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 PATHNAME: If designating an image, base64 encoded inline image data. T: PRINC-TO-STRING of THING
  • Method RESOLVE ((thing t))
  • Method RESOLVE ((thing t))
  • Method RESOLVE ((thing t))
  • Method RESOLVE ((file pathname))
  • Method RESOLVE ((file pathname))
  • Method RESOLVE ((file pathname))
  • Method RESOLVE ((thing symbol))
  • Method RESOLVE ((thing symbol))
  • Method RESOLVE ((thing symbol))
  • Method RESOLVE ((thing array))
  • Method RESOLVE ((thing array))
  • Method RESOLVE ((thing array))
  • Method RESOLVE ((thing null))
  • Method RESOLVE ((thing null))
  • Method RESOLVE ((thing null))
  • Function MAKE-PROPERTY (property &optional value)
    Creates a property object with PROPERTY as its key and VALUE as its value.
  • Function MAKE-BLOCK (selector values)
    Creates a block object with SELECTOR and VALUES.
  • Generic-Function COMPILE-PROPERTY (key value)
    Compile a property of KEY and VALUE to a list of property objects. By default, the following cases are handled: (T LIST) A list is created with one property object, wherein the property-value is the Space-concatenated list of RESOLVEd VALUEs. The KEY is DOWNCASEd. (T T) A list is created with one property object, wherein the property-value is the RESOLVEd VALUE. The KEY is DOWNCASEd. Special handling of properties may occur. See DEFINE-SPECIAL-PROPERTY
  • Method COMPILE-PROPERTY (key value)
  • Method COMPILE-PROPERTY (key value)
  • Method COMPILE-PROPERTY (key value)
  • Method COMPILE-PROPERTY (key (value list))
  • Method COMPILE-PROPERTY (key (value list))
  • Method COMPILE-PROPERTY (key (value list))
  • Generic-Function COMPILE-CONSTRAINT (func args)
    Compiles a constraint of type FUNC with arguments ARGS to a list of alternative selectors. By default, the following cases are handled: (T T) Concatenates its ARGS together with spaces. Preserves OR combinations. (NULL NULL) Returns NIL (T NULL) Returns FUNC (:OR T) Passes all ARGS to COMPILE-SELECTOR individually and then APPENDS all the results together. (:AND T) Concatenates its ARGS together without spaces. Preserves OR combinations. Special handling of constraints may occur. See DEFINE-SPECIAL-SELECTOR.
  • Method COMPILE-CONSTRAINT ((func (eql :and)) args)
  • Method COMPILE-CONSTRAINT ((func (eql :and)) args)
  • Method COMPILE-CONSTRAINT ((func (eql :and)) args)
  • Method COMPILE-CONSTRAINT ((func (eql :or)) args)
  • Method COMPILE-CONSTRAINT ((func (eql :or)) args)
  • Method COMPILE-CONSTRAINT ((func (eql :or)) args)
  • Method COMPILE-CONSTRAINT ((func null) (args null))
  • Method COMPILE-CONSTRAINT ((func null) (args null))
  • Method COMPILE-CONSTRAINT ((func null) (args null))
  • Method COMPILE-CONSTRAINT (func args)
  • Method COMPILE-CONSTRAINT (func args)
  • Method COMPILE-CONSTRAINT (func args)
  • Generic-Function COMPILE-SELECTOR (selector)
    Compiles the SELECTOR form into a list of alternative selectors. By default, the following cases are handled: (NULL) Returns NIL. (LIST) Calls COMPILE-CONSTRAINT with the SELECTOR's CAR and CDR. (T) Returns a list with the RESOLVEd SELECTOR.
  • Method COMPILE-SELECTOR ((selector t))
  • Method COMPILE-SELECTOR ((selector t))
  • Method COMPILE-SELECTOR ((selector t))
  • Method COMPILE-SELECTOR ((selector list))
  • Method COMPILE-SELECTOR ((selector list))
  • Method COMPILE-SELECTOR ((selector list))
  • Method COMPILE-SELECTOR ((selector null))
  • Method COMPILE-SELECTOR ((selector null))
  • Method COMPILE-SELECTOR ((selector null))
  • Generic-Function 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.
  • Method CONSUME-ITEM ((property symbol) readable-list)
  • Method CONSUME-ITEM ((property symbol) readable-list)
  • Method CONSUME-ITEM ((property symbol) readable-list)
  • Method CONSUME-ITEM ((subblock list) readable-list)
  • Method CONSUME-ITEM ((subblock list) readable-list)
  • Method CONSUME-ITEM ((subblock list) readable-list)
  • Method CONSUME-ITEM (thing readable-list)
  • Method CONSUME-ITEM (thing readable-list)
  • Method CONSUME-ITEM (thing readable-list)
  • Generic-Function COMPILE-BLOCK (header fields)
    Compiles the block with given HEADER and FIELDS list. By default, the following case is handled: (T T) Blocks are handled in the following way: The HEADER is used as a selector and compiled through COMPILE-SELECTOR. Fields are semantically segregated through KEYWORDS and LISTS. Every time a KEYWORD is encountered, it is taken as the current property and all following objects until either a LIST or a KEYWORD is encountered are gathered as the property's values. Every time a LIST is encountered, it is taken as a SUB-BLOCK and is passed to COMPILE-BLOCK with the HEADER being the current block's selector prepended to the selector of the sub-block. Special handling of blocks may occur. See DEFINE-SPECIAL-BLOCK.
  • Method COMPILE-BLOCK (selector fields)
  • Method COMPILE-BLOCK (selector fields)
  • Method COMPILE-BLOCK (selector fields)
  • Function COMPILE-SHEET (&rest blocks)
    Compiles a LASS sheet composed of BLOCKS. Each BLOCK is passed to COMPILE-BLOCK. The results thereof are appended together into one list of blocks and properties.
  • Function PROPERTY-FUNCTION (name)
    Returns a function to process a property function of NAME, if any.
  • Function (setf PROPERTY-FUNCTION) (function name)
    Sets FUNCTION as the new processor for the property function NAME.
  • Function REMOVE-PROPERTY-FUNCTION (name)
    Removes the property function NAME.
  • Macro 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.
  • Macro DEFINE-SIMPLE-PROPERTY-FUNCTION (name args)
    Defines a property function that returns name(arg1,arg2...). Only required arguments are allowed.
  • Function RESOLVE-FUNCTION (function &rest args)
    Turns the FUNCTION with its ARGS into a properly usable property value.
  • Method RESOLVE ((thing list))
  • Method CONSUME-ITEM ((property symbol) readable-list)
  • Macro 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.
  • Macro 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.
  • Macro 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.
  • Variable *PRETTY*
    t
    Directs whether to pretty-print using whitespace or not.
  • Variable *INDENT-LEVEL*
    0
    Directs the current amount of spaces used to indent.
  • Function INDENT
    Returns a string of the appropriate number of spaces depending on *PRETTY* and *INDENT-LEVEL*
  • Generic-Function WRITE-SHEET-OBJECT (type object stream)
    Writes the OBJECT of type TYPE to STREAM. By default the following TYPEs are handled: :BLOCK (SELECTOR-LIST OBJECTS*) Prints the SELECTOR-LIST separated by commas, followed by an opening brace and the printed list of OBJECTS using WRITE-SHEET-PART. Finally the body is closed off with a closing brace. Newlines and spaces may be inserted where necessary if *PRETTY* is non-NIL. :PROPERTY (KEY VALUE) Prints the KEY. If VALUE is non-NIL, a colon is printed followed by the VALUE. Finally a semicolon is printed. Spaces may be inserted where necessary if *PRETTY* is non-NIL.
  • Method WRITE-SHEET-OBJECT ((type (eql :text)) block stream)
  • Method WRITE-SHEET-OBJECT ((type (eql :text)) block stream)
  • Method WRITE-SHEET-OBJECT ((type (eql :text)) block stream)
  • Method WRITE-SHEET-OBJECT ((type (eql :property)) attribute stream)
  • Method WRITE-SHEET-OBJECT ((type (eql :property)) attribute stream)
  • Method WRITE-SHEET-OBJECT ((type (eql :property)) attribute stream)
  • Method WRITE-SHEET-OBJECT ((type (eql :block)) block stream)
  • Method WRITE-SHEET-OBJECT ((type (eql :block)) block stream)
  • Method WRITE-SHEET-OBJECT ((type (eql :block)) block stream)
  • Function WRITE-SHEET-PART (stream block cp ap)
    Wrapper around WRITE-SHEET-OBJECT so that we can call it from FORMAT. Calls WRITE-SHEET-OBJECT with (CAR BLOCK) (CDR BLOCK) STREAM.
  • Function WRITE-SHEET (sheet &key (stream nil) (pretty *pretty*))
    Writes the compiled SHEET object to STREAM. If PRETTY is non-NIL, spaces and newlines are inserted as appropriate in order to create a human-readable stylesheet. Otherwise whitespace is only used where necessary, producing a minified version. STREAM can be a STREAM, T for *STANDARD-OUTPUT*, or NIL for a STRING.
  • Macro DEFINE-SPECIAL-BLOCK (name args &body body)
    Define handling of a special block type. In order for the block to be recognised, it has to begin with the NAME as a keyword. The ARGS is a lambda-list that parses the block contents. Expected as a return value is a /list/ of either attributes or blocks. See COMPILE-BLOCK
  • Macro DEFINE-SPECIAL-PROPERTY (name args &body body)
    Define handling of a special property. The ARGS is a lambda-list that parses the arguments passed to the property. Expected as a return value is a /list/ of either attributes or blocks. See COMPILE-PROPERTY
  • Macro DEFINE-SPECIAL-SELECTOR (name args &body body)
    Define handling of a special selector type. In order for the selector to be recognised, it has to begin with the NAME as a keyword. The ARGS is a lambda-list that parses the selector contents. Expected as a return value is a /list/ of alternate versions of selectors. See COMPILE-CONSTRAINT.
  • Function GENERATE (in &key (out (merge-pathnames (make-pathname :type "css") in)) (pretty nil) (if-exists :supersede))
    Generate a CSS file from a LASS file. IN --- The LASS input file. Has to be READable. OUT --- The target file, by default a file of same location and name, but with CSS type. PRETTY --- Whether to minify or not. See WRITE-SHEET. IF-EXISTS --- See WITH-OPEN-FILE Returns OUT
  • Function COMPILE-AND-WRITE (&rest forms)
    Shortcut for (WRITE-SHEET (COMPILE-SHEET FORMS*))
  • Method COMPILE-BLOCK ((type215 (eql :charset)) args214)
  • Method COMPILE-BLOCK ((type248 (eql :document)) args247)
  • Method COMPILE-BLOCK ((type286 (eql :font-face)) args285)
  • Method COMPILE-BLOCK ((type302 (eql :import)) args301)
  • Method COMPILE-BLOCK ((type348 (eql :keyframes)) args347)
  • Method COMPILE-BLOCK ((type381 (eql :media)) args380)
  • Method COMPILE-BLOCK ((type419 (eql :namespace)) args418)
  • Method COMPILE-BLOCK ((type456 (eql :page)) args455)
  • Method COMPILE-BLOCK ((type492 (eql :supports)) args491)
  • Method COMPILE-BLOCK ((type552 (eql :let)) args551)
  • Method COMPILE-CONSTRAINT ((func628 (eql :=)) args627)
  • Method COMPILE-CONSTRAINT ((func676 (eql :~=)) args675)
  • Method COMPILE-CONSTRAINT ((func724 (eql :*=)) args723)
  • Method COMPILE-CONSTRAINT ((func772 (eql :$=)) args771)
  • Method COMPILE-CONSTRAINT ((func820 (eql :^=)) args819)
  • Method COMPILE-CONSTRAINT ((func868 (eql :/=)) args867)
  • Macro DEFINE-SINGLE-ARG-SELECTOR (name)
    Helper macro to define a single-argument pseudo-selector like NOT or NTH-CHILD.
  • Method COMPILE-CONSTRAINT ((func937 (eql :dir)) args936)
  • Method COMPILE-CONSTRAINT ((func986 (eql :lang)) args985)
  • Method COMPILE-CONSTRAINT ((func1035 (eql :not)) args1034)
  • Method COMPILE-CONSTRAINT ((func1084 (eql :nth-child)) args1083)
  • Method COMPILE-CONSTRAINT ((func1133 (eql :nth-last-child)) args1132)
  • Method COMPILE-CONSTRAINT ((func1182 (eql :nth-last-of-type)) args1181)
  • Method COMPILE-CONSTRAINT ((func1231 (eql :nth-of-type)) args1230)
  • Method COMPILE-PROPERTY ((attr1280 (eql :font-family)) args1279)
  • Method COMPILE-PROPERTY ((attr1323 (eql :content)) args1322)
  • Macro DEFINE-BROWSER-PROPERTY (name args &body browser-options)
    Helper macro to define properties that have browser-dependant versions. NAME --- The base name of the property name or value. ARGS --- Property arguments, see DEFINE-SPECIAL-PROPERTY. BROWSER-OPTIONS ::= (OPTION (symbol) FORM*) OPTION ::= :MOZ | :O | :WEBKIT | :MS | :W3C | :DEFAULT Each browser-option body should return a single property. The SYMBOL in the option definition is bound to the computed property name (eg -moz-NAME for the :MOZ option). 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.
  • Method COMPILE-PROPERTY ((attr1453 (eql :linear-gradient)) args1452)
  • Method COMPILE-PROPERTY ((attr1636 (eql :radial-gradient)) args1635)
  • Method COMPILE-PROPERTY ((attr1859 (eql :repeating-radial-gradient)) args1858)
  • Method COMPILE-PROPERTY ((attr2047 (eql :transform)) args2046)
  • Method COMPILE-PROPERTY ((attr2220 (eql :transform-origin)) args2219)
  • Method COMPILE-PROPERTY ((attr2353 (eql :transform-style)) args2352)
  • Method COMPILE-PROPERTY ((attr2371 (eql :transition)) args2370)
  • Method COMPILE-PROPERTY ((attr2674 (eql :transition-delay)) args2673)
  • Method COMPILE-PROPERTY ((attr2692 (eql :transition-duration)) args2691)
  • Method COMPILE-PROPERTY ((attr2710 (eql :transition-property)) args2709)
  • Method COMPILE-PROPERTY ((attr2728 (eql :transition-timing-function)) args2727)
  • Method COMPILE-PROPERTY ((attr2901 (eql :user-select)) args2900)
  • Method COMPILE-PROPERTY ((attr2919 (eql :appearance)) args2918)
  • Method CONSUME-ITEM ((property2941 (eql :filter)) readable2938)
  • Method COMPILE-PROPERTY ((attr3240 (eql :filter)) args3239)
  • Method COMPILE-PROPERTY ((attr3391 (eql :box-shadow)) args3390)
  • Class LASS-FILE  (SOURCE-FILE)
    An ASDF source-file component to allow compilation of LASS to CSS in ASDF systems.
    OUTPUT   Accessor: OUTPUT