((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/scss" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "egg")) (section 2 "scss" (toc) (section 3 "Description" (p "An implementation of the s-expression based CSS notation SCSS. It slightly modifies and extends the original implementation of the " (link "http://celtic.benderweb.net/webit/" "WebIt!") " (site seems defunct) framework.")) (section 3 "Author" (p (int-link "/users/moritz-heidkamp" "Moritz Heidkamp"))) (section 3 "Documentation" (p "Only the emitter side is implemented at the moment.") (section 4 "Syntax" (pre "stylesheet ::= (css <import-clause>* <rule>+)\n\nimport-clause ::= (import <string>)\n\nrule ::= (<complex-selector> <declaration>+)\n\ncomplex-selector ::= <single-selector> |\n                     <grouping-selector>\n\nsimple-selector ::= <symbol> |\n                    (= class <symbol>) |\n                    (= class <simple-selector> <symbol>) |\n                    (= pclass <symbol>) |\n                    (= pclass <simple-selector> <symbol>) |\n                    (= id <symbol>) |\n                    (= id <simple-selector> <symbol>)\n\npath-selector ::= (<combinator> <single-selector>+)\n\ncombinator ::= // | + | >\n\nsingle-selector ::= <simple-selector> |\n                    <path-selector>\n\ngrouping-selector ::= (<single-selector>+)\n\ndeclaration ::= (<symbol> <scheme-expression>) |\n                (! (<symbol> <scheme-expression>))") (p "Alternatively the following extended syntax dubbed " (i "SCSS Plus") " is available:") (pre "stylesheet ::= (css+ <import-clause>* <rule>+)\n\nimport-clause ::= (import <string>)\n\nrule ::= (<complex-selector> [<declaration> | <nested-rule>]+)\n\nnested-rule ::= (<path-selector> [<declaration> | <nested-rule>]+)\n\ncomplex-selector ::= <single-selector> |\n                     <grouping-selector>\n\nsimple-selector ::= <symbol> |\n                    (= class <symbol>) |\n                    (= class <simple-selector> <symbol>) |\n                    (= pclass <symbol>) |\n                    (= pclass <simple-selector> <symbol>) |\n                    (= id <symbol>) |\n                    (= id <simple-selector> <symbol>)\n\npath-selector ::= (<combinator> <single-selector>+)\n\ncombinator ::= // | + | > | &\n\nsingle-selector ::= <simple-selector> |\n                    <path-selector>\n\ngrouping-selector ::= (<single-selector>+)\n\ndeclaration ::= (<symbol> <scheme-expression>) |\n                (! (<symbol> <scheme-expression>))") (p "The two differences are that you can nest rules which results in much more compact stylesheets as well as use the " (tt "&") " combinator which will concatenate nested selectors.")) (section 4 "Emitter" (def (sig (procedure "(write-css scss [port])" (id write-css))) (p "Write the CSS translation of " (tt "scss") " (which is a list following the syntax described under " (int-link "#syntax" "Syntax") ") to " (tt "port") ".")) (def (sig (procedure "(css->scss scss)" (id css->scss))) (p "Like " (tt "write-css") " but returns the CSS translation as a string instead of writing it to a port."))) (section 4 "scss2css" (p (tt "scss2css") " is a program that is installed with this egg. It takes a file name argument which should contain an SCSS document. If no file name is given it will read from standard input instead. The document will be " (tt "read") " and " (tt "eval") "ed. The result of that is passed to " (tt "scss->css") " which in turn writes the resulting CSS to standard output. When the " (tt "-n") " option is passed the document won't be " (tt "eval") "ed."))) (section 3 "Examples" (section 4 "Basic " (highlight scheme "(write-css '(css (p (text-align center))))") (p "=>") (highlight css "p { text-align: center } ")) (section 4 "More Complex" (highlight scheme "(write-css '(css (((= class p note) (+ p p))\n                  (font-style italic)\n                  (background-color \"#ccc\"))\n                 (|#content| \n                  (width 100em))))") (p "=>") (highlight css "p.note, p + p { font-style: italic; background-color: #ccc }\n#content { width: 100em }")) (section 4 "SCSS Plus" (highlight scheme "(write-css '(css+ ((= id main)\n                   (display block)\n                   ((// p)\n                    (font-size 1em)\n                    ((& .error)\n                     (! (color red)))))))") (p "=>") (highlight css "#main { display: block }\n#main p { font-size: 1em }\n#main p.error { color: red !important }"))) (section 3 "History" (dl (dt "4") (dd "First version to be compatible with CHICKEN 5.") (dt "3") (dd "Failed attempt at CHICKEN 5 compatibiltity.") (dt "2") (dd "Failed attempt at CHICKEN 5 compatibiltity.") (dt "1") (dd "Failed attempt at CHICKEN 5 compatibiltity.") (dt "0.5.0") (dd "Re-implemented from scratch, fixing various corner cases. The undocumented " (tt "scss-plus") " module that was installed by previous versions does not exist anymore. " (tt "scss->css") " returns a string instead of writing to a port. Instead, " (tt "write-css") " can be used to write to a port now."))) (section 3 "License" (pre " Copyright (c) 2010-2018, Moritz Heidkamp\n All rights reserved.\n \n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n \n Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n \n Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n \n Neither the name of the author nor the names of its contributors may\n be used to endorse or promote products derived from this software\n without specific prior written permission.\n \n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n OF THE POSSIBILITY OF SUCH DAMAGE."))))