frontsau 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +30 -0
- data/Rakefile +2 -0
- data/bin/frontsau +15 -0
- data/bin/frontsau-phaml-compiler +35 -0
- data/example/.frontsau +12 -0
- data/example/assets/head.jpg +0 -0
- data/example/assets/script.js +4 -0
- data/example/assets/style.css +6 -0
- data/example/css/includes.sass +2 -0
- data/example/css/style.sass +6 -0
- data/example/image/head.jpg +0 -0
- data/example/index.html +0 -0
- data/example/js/script.coffee +1 -0
- data/frontsau.gemspec +41 -0
- data/lib/Phamlp/Phamlp.php +72 -0
- data/lib/Phamlp/PhamlpException.php +31 -0
- data/lib/Phamlp/haml/HamlException.php +29 -0
- data/lib/Phamlp/haml/HamlHelpers.php +199 -0
- data/lib/Phamlp/haml/HamlParser.php +1250 -0
- data/lib/Phamlp/haml/filters/HamlBaseFilter.php +30 -0
- data/lib/Phamlp/haml/filters/HamlCdataFilter.php +29 -0
- data/lib/Phamlp/haml/filters/HamlCssFilter.php +30 -0
- data/lib/Phamlp/haml/filters/HamlEscapedFilter.php +32 -0
- data/lib/Phamlp/haml/filters/HamlJavascriptFilter.php +31 -0
- data/lib/Phamlp/haml/filters/HamlPhpFilter.php +27 -0
- data/lib/Phamlp/haml/filters/HamlPlainFilter.php +28 -0
- data/lib/Phamlp/haml/filters/HamlPreserveFilter.php +29 -0
- data/lib/Phamlp/haml/filters/HamlSassFilter.php +37 -0
- data/lib/Phamlp/haml/filters/HamlScssFilter.php +37 -0
- data/lib/Phamlp/haml/filters/_HamlMarkdownFilter.php +50 -0
- data/lib/Phamlp/haml/filters/_HamlTextileFilter.php +50 -0
- data/lib/Phamlp/haml/messages/_i18n.php +32 -0
- data/lib/Phamlp/haml/messages/de.php +32 -0
- data/lib/Phamlp/haml/messages/fr.php +32 -0
- data/lib/Phamlp/haml/renderers/HamlCompactRenderer.php +32 -0
- data/lib/Phamlp/haml/renderers/HamlCompressedRenderer.php +48 -0
- data/lib/Phamlp/haml/renderers/HamlExpandedRenderer.php +58 -0
- data/lib/Phamlp/haml/renderers/HamlNestedRenderer.php +77 -0
- data/lib/Phamlp/haml/renderers/HamlRenderer.php +137 -0
- data/lib/Phamlp/haml/tree/HamlCodeBlockNode.php +58 -0
- data/lib/Phamlp/haml/tree/HamlCommentNode.php +41 -0
- data/lib/Phamlp/haml/tree/HamlDoctypeNode.php +27 -0
- data/lib/Phamlp/haml/tree/HamlElementNode.php +52 -0
- data/lib/Phamlp/haml/tree/HamlFilterNode.php +50 -0
- data/lib/Phamlp/haml/tree/HamlHelperNode.php +73 -0
- data/lib/Phamlp/haml/tree/HamlNode.php +253 -0
- data/lib/Phamlp/haml/tree/HamlNodeExceptions.php +19 -0
- data/lib/Phamlp/haml/tree/HamlRootNode.php +58 -0
- data/lib/Phamlp/sass/SassException.php +29 -0
- data/lib/Phamlp/sass/SassFile.php +164 -0
- data/lib/Phamlp/sass/SassParser.php +848 -0
- data/lib/Phamlp/sass/extensions/compass/config.php +65 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/_blueprint.scss +47 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_buttons.scss +101 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_colors.scss +32 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_debug.scss +11 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss +86 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_form.scss +68 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_grid.scss +249 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_ie.scss +109 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_interaction.scss +57 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_link-icons.scss +37 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_liquid.scss +147 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_print.scss +93 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_reset.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_rtl.scss +133 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_scaffolding.scss +54 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_typography.scss +104 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/_utilities.scss +37 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/stylesheets/blueprint/reset/_utilities.scss +58 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/grid.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/ie.sass +4 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/manifest.rb +30 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/partials/_base.sass +10 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/print.sass +4 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/basic/screen.sass +12 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons/cross.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons/key.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons/tick.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/buttons.sass +49 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/buttons/manifest.rb +17 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/doc.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/email.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/external.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/feed.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/im.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/pdf.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/visited.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons/xls.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/link_icons.sass +13 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/link_icons/manifest.rb +23 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/grid.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/ie.sass +16 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/manifest.rb +30 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/partials/_base.sass +11 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/print.sass +8 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/project/screen.sass +45 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/grid.png +0 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/ie.sass +16 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/manifest.rb +33 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_base.sass +10 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_form.sass +6 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_page.sass +18 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/partials/_two_col.sass +38 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/print.sass +5 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/blueprint/templates/semantic/screen.sass +14 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/_compass.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_css3.scss +15 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_layout.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_reset.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/_utilities.scss +6 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_background-clip.scss +43 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_background-origin.scss +42 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_background-size.scss +14 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_border-radius.scss +135 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +50 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_box-sizing.scss +13 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_box.scss +112 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_columns.scss +55 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_font-face.scss +33 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_gradient.scss +82 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_inline-block.scss +12 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_opacity.scss +27 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_shared.scss +47 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_text-shadow.scss +25 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_transform.scss +85 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/css3/_transition.scss +85 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/layout/_sticky-footer.scss +23 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/reset/_utilities.scss +133 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_general.scss +6 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_links.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_lists.scss +4 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_print.scss +17 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_sprites.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_tables.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/_text.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss +31 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_float.scss +15 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +35 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_min.scss +16 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_reset.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_tabs.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/general/_tag-cloud.scss +18 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/links/_hover-link.scss +5 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/links/_link-colors.scss +28 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/links/_unstyled-link.scss +7 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_bullets.scss +34 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss +52 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss +47 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss +29 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/sprites/_sprite-img.scss +56 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/tables/_alternating-rows-and-columns.scss +20 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/tables/_borders.scss +27 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/tables/_scaffolding.scss +9 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/text/_ellipsis.scss +25 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/text/_nowrap.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss +34 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/ellipsis/ellipsis.sass +9 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/ellipsis/manifest.rb +27 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/ellipsis/xml/ellipsis.xml +14 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/manifest.rb +20 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/stylesheets/main.sass +1 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/templates/project/manifest.rb +2 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/extension/templates/project/screen.sass +2 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/USAGE.markdown +32 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/ie.sass +6 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/manifest.rb +4 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/print.sass +6 -0
- data/lib/Phamlp/sass/extensions/compass/frameworks/compass/templates/project/screen.sass +7 -0
- data/lib/Phamlp/sass/extensions/compass/functions/colourStops.php +268 -0
- data/lib/Phamlp/sass/extensions/compass/functions/constants.php +44 -0
- data/lib/Phamlp/sass/extensions/compass/functions/fontFiles.php +30 -0
- data/lib/Phamlp/sass/extensions/compass/functions/imageSize.php +39 -0
- data/lib/Phamlp/sass/extensions/compass/functions/inlineData.php +84 -0
- data/lib/Phamlp/sass/extensions/compass/functions/lists.php +47 -0
- data/lib/Phamlp/sass/extensions/compass/functions/selectors.php +128 -0
- data/lib/Phamlp/sass/extensions/compass/functions/urls.php +143 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/_compass.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_css3.scss +15 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_layout.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_reset.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/_utilities.scss +6 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_background-clip.scss +43 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_background-origin.scss +42 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_background-size.scss +14 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_border-radius.scss +135 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_box-shadow.scss +50 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_box-sizing.scss +13 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_box.scss +112 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_columns.scss +55 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_font-face.scss +33 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_gradient.scss +96 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_inline-block.scss +12 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_opacity.scss +27 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_shared.scss +47 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_text-shadow.scss +25 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_transform.scss +85 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/css3/_transition.scss +85 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/layout/_sticky-footer.scss +23 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/reset/_utilities.scss +133 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_general.scss +6 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_links.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_lists.scss +4 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_print.scss +17 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_sprites.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_tables.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/_text.scss +3 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_clearfix.scss +31 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_float.scss +15 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_hacks.scss +35 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_min.scss +16 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_reset.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_tabs.scss +1 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/general/_tag-cloud.scss +18 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/links/_hover-link.scss +5 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/links/_link-colors.scss +28 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/links/_unstyled-link.scss +7 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_bullets.scss +34 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss +52 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss +47 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/lists/_inline-list.scss +29 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/sprites/_sprite-img.scss +56 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/tables/_alternating-rows-and-columns.scss +20 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/tables/_borders.scss +27 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/tables/_scaffolding.scss +9 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/text/_ellipsis.scss +25 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/text/_nowrap.scss +2 -0
- data/lib/Phamlp/sass/extensions/compass/stylesheets/compass/utilities/text/_replacement.scss +34 -0
- data/lib/Phamlp/sass/messages/_i18n.php +122 -0
- data/lib/Phamlp/sass/messages/de.php +70 -0
- data/lib/Phamlp/sass/messages/fr.php +70 -0
- data/lib/Phamlp/sass/renderers/SassCompactRenderer.php +130 -0
- data/lib/Phamlp/sass/renderers/SassCompressedRenderer.php +102 -0
- data/lib/Phamlp/sass/renderers/SassExpandedRenderer.php +62 -0
- data/lib/Phamlp/sass/renderers/SassNestedRenderer.php +61 -0
- data/lib/Phamlp/sass/renderers/SassRenderer.php +51 -0
- data/lib/Phamlp/sass/script/SassScriptFunction.php +169 -0
- data/lib/Phamlp/sass/script/SassScriptFunctions.php +751 -0
- data/lib/Phamlp/sass/script/SassScriptLexer.php +114 -0
- data/lib/Phamlp/sass/script/SassScriptOperation.php +151 -0
- data/lib/Phamlp/sass/script/SassScriptParser.php +192 -0
- data/lib/Phamlp/sass/script/SassScriptParserExceptions.php +40 -0
- data/lib/Phamlp/sass/script/SassScriptVariable.php +57 -0
- data/lib/Phamlp/sass/script/literals/SassBoolean.php +67 -0
- data/lib/Phamlp/sass/script/literals/SassColour.php +886 -0
- data/lib/Phamlp/sass/script/literals/SassLiteral.php +359 -0
- data/lib/Phamlp/sass/script/literals/SassLiteralExceptions.php +47 -0
- data/lib/Phamlp/sass/script/literals/SassNumber.php +503 -0
- data/lib/Phamlp/sass/script/literals/SassString.php +106 -0
- data/lib/Phamlp/sass/tree/SassCommentNode.php +64 -0
- data/lib/Phamlp/sass/tree/SassContext.php +120 -0
- data/lib/Phamlp/sass/tree/SassDebugNode.php +84 -0
- data/lib/Phamlp/sass/tree/SassDirectiveNode.php +76 -0
- data/lib/Phamlp/sass/tree/SassElseNode.php +28 -0
- data/lib/Phamlp/sass/tree/SassExtendNode.php +47 -0
- data/lib/Phamlp/sass/tree/SassForNode.php +99 -0
- data/lib/Phamlp/sass/tree/SassIfNode.php +95 -0
- data/lib/Phamlp/sass/tree/SassImportNode.php +69 -0
- data/lib/Phamlp/sass/tree/SassMixinDefinitionNode.php +88 -0
- data/lib/Phamlp/sass/tree/SassMixinNode.php +91 -0
- data/lib/Phamlp/sass/tree/SassNode.php +342 -0
- data/lib/Phamlp/sass/tree/SassNodeExceptions.php +117 -0
- data/lib/Phamlp/sass/tree/SassPropertyNode.php +239 -0
- data/lib/Phamlp/sass/tree/SassRootNode.php +100 -0
- data/lib/Phamlp/sass/tree/SassRuleNode.php +337 -0
- data/lib/Phamlp/sass/tree/SassVariableNode.php +90 -0
- data/lib/Phamlp/sass/tree/SassWhileNode.php +64 -0
- data/lib/frontsau/assets/rack.rb +12 -0
- data/lib/frontsau/assets/sprockets.rb +59 -0
- data/lib/frontsau/assets/static_assets_compiler.rb +50 -0
- data/lib/frontsau/assets/url_rewriter.rb +22 -0
- data/lib/frontsau/assets/watcher.rb +60 -0
- data/lib/frontsau/thor_app.rb +118 -0
- data/lib/frontsau/version.rb +3 -0
- data/lib/frontsau.rb +64 -0
- metadata +578 -0
@@ -0,0 +1,70 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassRuleNode.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
|
3
|
+
/**
|
4
|
+
* Message translations.
|
5
|
+
*
|
6
|
+
* This file is contains the localizable messages for Sass. You may modify this
|
7
|
+
* file by translating the messages and saving with the filename language.php
|
8
|
+
* where "language" is the language ID of the translations.
|
9
|
+
*
|
10
|
+
* Each array element represents the translation (value) of a message (key).
|
11
|
+
* If the value is empty the message is considered as not translated.
|
12
|
+
*
|
13
|
+
* NOTE: this file must be saved in UTF-8 encoding.
|
14
|
+
*
|
15
|
+
* @author Chris Yates <chris.l.yates@gmail.com>
|
16
|
+
* @copyright Copyright (c) 2010 PBM Web Development
|
17
|
+
* @license http://phamlp.googlecode.com/files/license.txt
|
18
|
+
* @package PHamlP
|
19
|
+
* @subpackage Sass.messages
|
20
|
+
*/
|
21
|
+
return array (
|
22
|
+
'@else(if) directive must come after @(else)if'=>'@else(if) directive doit venir après @(else)if',
|
23
|
+
'Amount to shift left'=>'Montant à décalage à gauche',
|
24
|
+
'Amount to shift right'=>'Montant à décalage à droite',
|
25
|
+
'between {min} and {max} inclusive'=>'entre les {min} et {max} inclusivement',
|
26
|
+
'Can not use parent selector (&) when no parent selectors'=>"Impossible d'utiliser le sélecteur parent (&) si aucun parent sélecteurs",
|
27
|
+
'Child classes must override this method'=>'Classes enfants doivent redéfinir cette méthode',
|
28
|
+
'{class} does not support {operation}.'=>'{class} ne mettre en œuvre {operation}.',
|
29
|
+
'Colours'=>'Couleur',
|
30
|
+
'colours'=>'couleurs',
|
31
|
+
'Illegal comment type'=>'Type de commentaire illégale',
|
32
|
+
'Illegal indentation ({level}); indentation can only increase by one'=>"Niveau niveau d'indentation illégale ({level}); ne peut augmenter d'un",
|
33
|
+
'import directives'=>"directives à l'importation",
|
34
|
+
'Incompatible units: {from} and {to}'=>'Unités incompatibles: {from} et {to}',
|
35
|
+
'Incorrect argument count for {method}; expected {expected}, received {received}'=>'Argument incorrect comptent pour {method}; attendu {expected}, reçu {received}',
|
36
|
+
'Incorrect operand count for {operation}; expected {expected}, received {received}'=>'Opérande incorrect comptent pour {operation}; attendu {expected}, reçu {received}',
|
37
|
+
'Invalid indentation'=>'Indentation blancs',
|
38
|
+
'Invalid units: {value}'=>'Unités blancs',
|
39
|
+
'Invalid variable definition; name and expression required'=>"Définition de la variable blancs, le nom et l'expression nécessaire",
|
40
|
+
'Invalid {what}'=>'Invalide {what}',
|
41
|
+
'Mixed indentation not allowed'=>'Indentation mixte pas autorisé',
|
42
|
+
'Mixin {which} directive shortcut not allowed in SCSS'=>'Mixin {which} directive shortcutraccourci pas admis dans SCSS',
|
43
|
+
"Mixin::{mname}: Required variable ({vname}) not given.\nMixin defined: {dfile}::{dline}\nMixin used: {ufile}::{uline}"=>"Mixin::{mname}: Variable requise ({vname}) n'est pas donnée.\nMixin défini: {dfile}::{dline}\nMixin utilisés",
|
44
|
+
'Mixin::{name}: Required variables must be defined before optional variables'=>'Mixin::{name}: Variables requises doivent être définies avant les variables facultatives',
|
45
|
+
'Mixins can only be defined at root level'=>'Mixins ne peuvent être définis au niveau de la racine',
|
46
|
+
'Nesting not allowed beneath {what}'=>'La mise en pages ne peuvent, sous',
|
47
|
+
'No getter function for {what}'=>'Pas de fonction getter pour {what}',
|
48
|
+
'No setter function for {what}'=>'Pas de fonction setter pour {what}',
|
49
|
+
'number'=>'nombre',
|
50
|
+
'Number'=>'Nombre',
|
51
|
+
'Properties can not be assigned at root level'=>'Propriétés ne peut pas être attribué au niveau de la racine',
|
52
|
+
'SassColour can not have HSL and RGB keys specified'=>'SassColour ne peut pas avoir HSL et RGB touches spécifiées',
|
53
|
+
'SassColour must have all {colourSpace} keys specified'=>'SassColour doit disposer de tous {colourSpace} touches spécifiées',
|
54
|
+
'SassColour array must have at least 3 elements'=>'SassColour array doit avoir au moins 3 éléments',
|
55
|
+
'Selectors can not end in a comma'=>'Sélecteurs ne peut pas se terminer par une virgule',
|
56
|
+
'Setting variables with "{sassDefault}=" is deprecated; use "${name}: {value}{scssDefault}"'=>'Définition des variables avec "{sassDefault}=" est obsolète, utiliser "${name}: {value}"',
|
57
|
+
'Unable to create document tree for {uri}'=>"Impossible de créer le document d'arbres pour {uri}",
|
58
|
+
'Unable to find {what}: {filename}'=>'Impossible de trouver {what}: {filename}',
|
59
|
+
'Undefined operation "{operation}" for {what}'=>'Non fonctionnement "{operation}" for {what}',
|
60
|
+
'Undefined {what}: {name}'=>'Indéfini {what}: {name}',
|
61
|
+
'unitless number'=>'nombre sans unité',
|
62
|
+
'Unknown property: {name}'=>'Propriété inconnue: {name}',
|
63
|
+
'Unmatched parentheses'=>'Inégalée parenthèses',
|
64
|
+
'Value'=>'Valeur',
|
65
|
+
'variables'=>'variables',
|
66
|
+
'Variables prefixed with "!" is deprecated; use "${name}"'=>'Variables préfixées par "!" est obsolète; utiliser "${name}',
|
67
|
+
'Warning'=>'Alerte',
|
68
|
+
'{what} must be a {type}'=>'{what} doit être un {type}',
|
69
|
+
'{what} must be {inRange}'=>'{what} doit être {inRange}',
|
70
|
+
);
|
@@ -0,0 +1,130 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassCompactRenderer.php 118 2010-09-21 09:45:11Z chris.l.yates@gmail.com $ */
|
3
|
+
/**
|
4
|
+
* SassCompactRenderer class file.
|
5
|
+
* @author Chris Yates <chris.l.yates@gmail.com>
|
6
|
+
* @copyright Copyright (c) 2010 PBM Web Development
|
7
|
+
* @license http://phamlp.googlecode.com/files/license.txt
|
8
|
+
* @package PHamlP
|
9
|
+
* @subpackage Sass.renderers
|
10
|
+
*/
|
11
|
+
|
12
|
+
require_once('SassCompressedRenderer.php');
|
13
|
+
|
14
|
+
/**
|
15
|
+
* SassCompactRenderer class.
|
16
|
+
* Each CSS rule takes up only one line, with every property defined on that
|
17
|
+
* line. Nested rules are placed next to each other with no newline, while
|
18
|
+
* groups of rules have newlines between them.
|
19
|
+
* @package PHamlP
|
20
|
+
* @subpackage Sass.renderers
|
21
|
+
*/
|
22
|
+
class SassCompactRenderer extends SassCompressedRenderer {
|
23
|
+
const DEBUG_INFO_RULE = '@media -sass-debug-info';
|
24
|
+
const DEBUG_INFO_PROPERTY = 'font-family';
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Renders the brace between the selectors and the properties
|
28
|
+
* @return string the brace between the selectors and the properties
|
29
|
+
*/
|
30
|
+
protected function between() {
|
31
|
+
return ' { ';
|
32
|
+
}
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Renders the brace at the end of the rule
|
36
|
+
* @return string the brace between the rule and its properties
|
37
|
+
*/
|
38
|
+
protected function end() {
|
39
|
+
return " }\n";
|
40
|
+
}
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Renders a comment.
|
44
|
+
* Comments preceeding a rule are on their own line.
|
45
|
+
* Comments within a rule are on the same line as the rule.
|
46
|
+
* @param SassNode the node being rendered
|
47
|
+
* @return string the rendered commnt
|
48
|
+
*/
|
49
|
+
public function renderComment($node) {
|
50
|
+
$nl = ($node->parent instanceof SassRuleNode?'':"\n");
|
51
|
+
return "$nl/* " . join("\n * ", $node->children) . " */$nl" ;
|
52
|
+
}
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Renders a directive.
|
56
|
+
* @param SassNode the node being rendered
|
57
|
+
* @param array properties of the directive
|
58
|
+
* @return string the rendered directive
|
59
|
+
*/
|
60
|
+
public function renderDirective($node, $properties) {
|
61
|
+
return str_replace("\n", '', parent::renderDirective($node, $properties)) .
|
62
|
+
"\n\n";
|
63
|
+
}
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Renders properties.
|
67
|
+
* @param SassNode the node being rendered
|
68
|
+
* @param array properties to render
|
69
|
+
* @return string the rendered properties
|
70
|
+
*/
|
71
|
+
public function renderProperties($node, $properties) {
|
72
|
+
return join(' ', $properties);
|
73
|
+
}
|
74
|
+
|
75
|
+
/**
|
76
|
+
* Renders a property.
|
77
|
+
* @param SassNode the node being rendered
|
78
|
+
* @return string the rendered property
|
79
|
+
*/
|
80
|
+
public function renderProperty($node) {
|
81
|
+
return "{$node->name}: {$node->value};";
|
82
|
+
}
|
83
|
+
|
84
|
+
/**
|
85
|
+
* Renders a rule.
|
86
|
+
* @param SassNode the node being rendered
|
87
|
+
* @param array rule properties
|
88
|
+
* @param string rendered rules
|
89
|
+
* @return string the rendered rule
|
90
|
+
*/
|
91
|
+
public function renderRule($node, $properties, $rules) {
|
92
|
+
return $this->renderDebug($node) . parent::renderRule($node, $properties,
|
93
|
+
str_replace("\n\n", "\n", $rules)) . "\n";
|
94
|
+
}
|
95
|
+
|
96
|
+
/**
|
97
|
+
* Renders debug information.
|
98
|
+
* If the node has the debug_info options set true the line number and filename
|
99
|
+
* are rendered in a format compatible with
|
100
|
+
* {@link https://addons.mozilla.org/en-US/firefox/addon/103988/ FireSass}.
|
101
|
+
* Else if the node has the line_numbers option set true the line number and
|
102
|
+
* filename are rendered in a comment.
|
103
|
+
* @param SassNode the node being rendered
|
104
|
+
* @return string the debug information
|
105
|
+
*/
|
106
|
+
protected function renderDebug($node) {
|
107
|
+
$indent = $this->getIndent($node);
|
108
|
+
$debug = '';
|
109
|
+
|
110
|
+
if ($node->debug_info) {
|
111
|
+
$debug = $indent . self::DEBUG_INFO_RULE . '{';
|
112
|
+
$debug .= 'filename{' . self::DEBUG_INFO_PROPERTY . ':' . preg_replace('/([^-\w])/', '\\\\\1', "file://{$node->filename}") . ';}';
|
113
|
+
$debug .= 'line{' . self::DEBUG_INFO_PROPERTY . ":'{$node->line}';}";
|
114
|
+
$debug .= "}\n";
|
115
|
+
}
|
116
|
+
elseif ($node->line_numbers) {
|
117
|
+
$debug .= "$indent/* line {$node->line} {$node->filename} */\n";
|
118
|
+
}
|
119
|
+
return $debug;
|
120
|
+
}
|
121
|
+
|
122
|
+
/**
|
123
|
+
* Renders rule selectors.
|
124
|
+
* @param SassNode the node being rendered
|
125
|
+
* @return string the rendered selectors
|
126
|
+
*/
|
127
|
+
protected function renderSelectors($node) {
|
128
|
+
return join(', ', $node->selectors);
|
129
|
+
}
|
130
|
+
}
|
@@ -0,0 +1,102 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassCompressedRenderer.php 118 2010-09-21 09:45:11Z chris.l.yates@gmail.com $ */
|
3
|
+
/**
|
4
|
+
* SassCompressedRenderer class file.
|
5
|
+
* @author Chris Yates <chris.l.yates@gmail.com>
|
6
|
+
* @copyright Copyright (c) 2010 PBM Web Development
|
7
|
+
* @license http://phamlp.googlecode.com/files/license.txt
|
8
|
+
* @package PHamlP
|
9
|
+
* @subpackage Sass.renderers
|
10
|
+
*/
|
11
|
+
/**
|
12
|
+
* SassCompressedRenderer class.
|
13
|
+
* Compressed style takes up the minimum amount of space possible, having no
|
14
|
+
* whitespace except that necessary to separate selectors and a newline at the
|
15
|
+
* end of the file. It's not meant to be human-readable
|
16
|
+
* @package PHamlP
|
17
|
+
* @subpackage Sass.renderers
|
18
|
+
*/
|
19
|
+
class SassCompressedRenderer extends SassRenderer {
|
20
|
+
/**
|
21
|
+
* Renders the brace between the selectors and the properties
|
22
|
+
* @return string the brace between the selectors and the properties
|
23
|
+
*/
|
24
|
+
protected function between() {
|
25
|
+
return '{';
|
26
|
+
}
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Renders the brace at the end of the rule
|
30
|
+
* @return string the brace between the rule and its properties
|
31
|
+
*/
|
32
|
+
protected function end() {
|
33
|
+
return '}';
|
34
|
+
}
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Returns the indent string for the node
|
38
|
+
* @param SassNode the node to return the indent string for
|
39
|
+
* @return string the indent string for this SassNode
|
40
|
+
*/
|
41
|
+
protected function getIndent($node) {
|
42
|
+
return '';
|
43
|
+
}
|
44
|
+
|
45
|
+
/**
|
46
|
+
* Renders a comment.
|
47
|
+
* @param SassNode the node being rendered
|
48
|
+
* @return string the rendered comment
|
49
|
+
*/
|
50
|
+
public function renderComment($node) {
|
51
|
+
return '';
|
52
|
+
}
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Renders a directive.
|
56
|
+
* @param SassNode the node being rendered
|
57
|
+
* @param array properties of the directive
|
58
|
+
* @return string the rendered directive
|
59
|
+
*/
|
60
|
+
public function renderDirective($node, $properties) {
|
61
|
+
return $node->directive . $this->between() . $this->renderProperties($node, $properties) . $this->end();
|
62
|
+
}
|
63
|
+
|
64
|
+
/**
|
65
|
+
* Renders properties.
|
66
|
+
* @param SassNode the node being rendered
|
67
|
+
* @param array properties to render
|
68
|
+
* @return string the rendered properties
|
69
|
+
*/
|
70
|
+
public function renderProperties($node, $properties) {
|
71
|
+
return join('', $properties);
|
72
|
+
}
|
73
|
+
|
74
|
+
/**
|
75
|
+
* Renders a property.
|
76
|
+
* @param SassNode the node being rendered
|
77
|
+
* @return string the rendered property
|
78
|
+
*/
|
79
|
+
public function renderProperty($node) {
|
80
|
+
return "{$node->name}:{$node->value};";
|
81
|
+
}
|
82
|
+
|
83
|
+
/**
|
84
|
+
* Renders a rule.
|
85
|
+
* @param SassNode the node being rendered
|
86
|
+
* @param array rule properties
|
87
|
+
* @param string rendered rules
|
88
|
+
* @return string the rendered directive
|
89
|
+
*/
|
90
|
+
public function renderRule($node, $properties, $rules) {
|
91
|
+
return (!empty($properties) ? $this->renderSelectors($node) . $this->between() . $this->renderProperties($node, $properties) . $this->end() : '') . $rules;
|
92
|
+
}
|
93
|
+
|
94
|
+
/**
|
95
|
+
* Renders the rule's selectors
|
96
|
+
* @param SassNode the node being rendered
|
97
|
+
* @return string the rendered selectors
|
98
|
+
*/
|
99
|
+
protected function renderSelectors($node) {
|
100
|
+
return join(',', $node->selectors);
|
101
|
+
}
|
102
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassExpandedRenderer.php 118 2010-09-21 09:45:11Z chris.l.yates@gmail.com $ */
|
3
|
+
/**
|
4
|
+
* SassExpandedRenderer class file.
|
5
|
+
* @author Chris Yates <chris.l.yates@gmail.com>
|
6
|
+
* @copyright Copyright (c) 2010 PBM Web Development
|
7
|
+
* @license http://phamlp.googlecode.com/files/license.txt
|
8
|
+
* @package PHamlP
|
9
|
+
* @subpackage Sass.renderers
|
10
|
+
*/
|
11
|
+
|
12
|
+
require_once('SassCompactRenderer.php');
|
13
|
+
|
14
|
+
/**
|
15
|
+
* SassExpandedRenderer class.
|
16
|
+
* Expanded is the typical human-made CSS style, with each property and rule
|
17
|
+
* taking up one line. Properties are indented within the rules, but the rules
|
18
|
+
* are not indented in any special way.
|
19
|
+
* @package PHamlP
|
20
|
+
* @subpackage Sass.renderers
|
21
|
+
*/
|
22
|
+
class SassExpandedRenderer extends SassCompactRenderer {
|
23
|
+
/**
|
24
|
+
* Renders the brace between the selectors and the properties
|
25
|
+
* @return string the brace between the selectors and the properties
|
26
|
+
*/
|
27
|
+
protected function between() {
|
28
|
+
return " {\n" ;
|
29
|
+
}
|
30
|
+
|
31
|
+
/**
|
32
|
+
* Renders the brace at the end of the rule
|
33
|
+
* @return string the brace between the rule and its properties
|
34
|
+
*/
|
35
|
+
protected function end() {
|
36
|
+
return "\n}\n\n";
|
37
|
+
}
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Renders a comment.
|
41
|
+
* @param SassNode the node being rendered
|
42
|
+
* @return string the rendered commnt
|
43
|
+
*/
|
44
|
+
public function renderComment($node) {
|
45
|
+
$indent = $this->getIndent($node);
|
46
|
+
$lines = explode("\n", $node->value);
|
47
|
+
foreach ($lines as &$line) {
|
48
|
+
$line = trim($line);
|
49
|
+
}
|
50
|
+
return "$indent/*\n$indent * ".join("\n$indent * ", $lines)."\n$indent */".(empty($indent)?"\n":'');
|
51
|
+
}
|
52
|
+
|
53
|
+
/**
|
54
|
+
* Renders properties.
|
55
|
+
* @param array properties to render
|
56
|
+
* @return string the rendered properties
|
57
|
+
*/
|
58
|
+
public function renderProperties($node, $properties) {
|
59
|
+
$indent = $this->getIndent($node).self::INDENT;
|
60
|
+
return $indent.join("\n$indent", $properties);
|
61
|
+
}
|
62
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassNestedRenderer.php 118 2010-09-21 09:45:11Z chris.l.yates@gmail.com $ */
|
3
|
+
/**
|
4
|
+
* SassNestedRenderer class file.
|
5
|
+
* @author Chris Yates <chris.l.yates@gmail.com>
|
6
|
+
* @copyright Copyright (c) 2010 PBM Web Development
|
7
|
+
* @license http://phamlp.googlecode.com/files/license.txt
|
8
|
+
* @package PHamlP
|
9
|
+
* @subpackage Sass.renderers
|
10
|
+
*/
|
11
|
+
|
12
|
+
require_once('SassExpandedRenderer.php');
|
13
|
+
|
14
|
+
/**
|
15
|
+
* SassNestedRenderer class.
|
16
|
+
* Nested style is the default Sass style, because it reflects the structure of
|
17
|
+
* the document in much the same way Sass does. Each rule is indented based on
|
18
|
+
* how deeply it's nested. Each property has its own line and is indented
|
19
|
+
* within the rule.
|
20
|
+
* @package PHamlP
|
21
|
+
* @subpackage Sass.renderers
|
22
|
+
*/
|
23
|
+
class SassNestedRenderer extends SassExpandedRenderer {
|
24
|
+
/**
|
25
|
+
* Renders the brace at the end of the rule
|
26
|
+
* @return string the brace between the rule and its properties
|
27
|
+
*/
|
28
|
+
protected function end() {
|
29
|
+
return " }\n";
|
30
|
+
}
|
31
|
+
|
32
|
+
/**
|
33
|
+
* Returns the indent string for the node
|
34
|
+
* @param SassNode the node being rendered
|
35
|
+
* @return string the indent string for this SassNode
|
36
|
+
*/
|
37
|
+
protected function getIndent($node) {
|
38
|
+
return str_repeat(self::INDENT, $node->level);
|
39
|
+
}
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Renders a directive.
|
43
|
+
* @param SassNode the node being rendered
|
44
|
+
* @param array properties of the directive
|
45
|
+
* @return string the rendered directive
|
46
|
+
*/
|
47
|
+
public function renderDirective($node, $properties) {
|
48
|
+
$directive = $this->getIndent($node) . $node->directive . $this->between() . $this->renderProperties($properties);
|
49
|
+
return preg_replace('/(.*})\n$/', '\1', $directive) . $this->end();
|
50
|
+
}
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Renders rule selectors.
|
54
|
+
* @param SassNode the node being rendered
|
55
|
+
* @return string the rendered selectors
|
56
|
+
*/
|
57
|
+
protected function renderSelectors($node) {
|
58
|
+
$indent = $this->getIndent($node);
|
59
|
+
return $indent.join(",\n$indent", $node->selectors);
|
60
|
+
}
|
61
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassRenderer.php 68 2010-04-18 13:24:41Z chris.l.yates $ */
|
3
|
+
/**
|
4
|
+
* SassRenderer class file.
|
5
|
+
* @author Chris Yates <chris.l.yates@gmail.com>
|
6
|
+
* @copyright Copyright (c) 2010 PBM Web Development
|
7
|
+
* @license http://phamlp.googlecode.com/files/license.txt
|
8
|
+
* @package PHamlP
|
9
|
+
* @subpackage Sass.renderers
|
10
|
+
*/
|
11
|
+
|
12
|
+
require_once('SassCompactRenderer.php');
|
13
|
+
require_once('SassCompressedRenderer.php');
|
14
|
+
require_once('SassExpandedRenderer.php');
|
15
|
+
require_once('SassNestedRenderer.php');
|
16
|
+
|
17
|
+
/**
|
18
|
+
* SassRenderer class.
|
19
|
+
* @package PHamlP
|
20
|
+
* @subpackage Sass.renderers
|
21
|
+
*/
|
22
|
+
class SassRenderer {
|
23
|
+
/**#@+
|
24
|
+
* Output Styles
|
25
|
+
*/
|
26
|
+
const STYLE_COMPRESSED = 'compressed';
|
27
|
+
const STYLE_COMPACT = 'compact';
|
28
|
+
const STYLE_EXPANDED = 'expanded';
|
29
|
+
const STYLE_NESTED = 'nested';
|
30
|
+
/**#@-*/
|
31
|
+
|
32
|
+
const INDENT = ' ';
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Returns the renderer for the required render style.
|
36
|
+
* @param string render style
|
37
|
+
* @return SassRenderer
|
38
|
+
*/
|
39
|
+
public static function getRenderer($style) {
|
40
|
+
switch ($style) {
|
41
|
+
case self::STYLE_COMPACT:
|
42
|
+
return new SassCompactRenderer();
|
43
|
+
case self::STYLE_COMPRESSED:
|
44
|
+
return new SassCompressedRenderer();
|
45
|
+
case self::STYLE_EXPANDED:
|
46
|
+
return new SassExpandedRenderer();
|
47
|
+
case self::STYLE_NESTED:
|
48
|
+
return new SassNestedRenderer();
|
49
|
+
} // switch
|
50
|
+
}
|
51
|
+
}
|
@@ -0,0 +1,169 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassScriptFunction.php 118 2010-09-21 09:45:11Z chris.l.yates@gmail.com $ */
|
3
|
+
/**
|
4
|
+
* SassScriptFunction class file.
|
5
|
+
* @author Chris Yates <chris.l.yates@gmail.com>
|
6
|
+
* @copyright Copyright (c) 2010 PBM Web Development
|
7
|
+
* @license http://phamlp.googlecode.com/files/license.txt
|
8
|
+
* @package PHamlP
|
9
|
+
* @subpackage Sass.script
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* SassScriptFunction class.
|
14
|
+
* Preforms a SassScript function.
|
15
|
+
* @package PHamlP
|
16
|
+
* @subpackage Sass.script
|
17
|
+
*/
|
18
|
+
class SassScriptFunction {
|
19
|
+
/**@#+
|
20
|
+
* Regexes for matching and extracting functions and arguments
|
21
|
+
*/
|
22
|
+
const MATCH = '/^(((-\w)|(\w))[-\w]*)\(/';
|
23
|
+
const MATCH_FUNC = '/^((?:(?:-\w)|(?:\w))[-\w]*)\((.*)\)/';
|
24
|
+
const SPLIT_ARGS = '/\s*((?:[\'"].*?["\'])|(?:.+?(?:\(.*\).*?)?))\s*(?:,|$)/';
|
25
|
+
const NAME = 1;
|
26
|
+
const ARGS = 2;
|
27
|
+
|
28
|
+
private $name;
|
29
|
+
private $args;
|
30
|
+
|
31
|
+
/**
|
32
|
+
* SassScriptFunction constructor
|
33
|
+
* @param string name of the function
|
34
|
+
* @param array arguments for the function
|
35
|
+
* @return SassScriptFunction
|
36
|
+
*/
|
37
|
+
public function __construct($name, $args) {
|
38
|
+
$this->name = $name;
|
39
|
+
$this->args = $args;
|
40
|
+
}
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Evaluates the function.
|
44
|
+
* Look for a user defined function first - this allows users to override
|
45
|
+
* pre-defined functions, then try the pre-defined functions.
|
46
|
+
* @return Function the value of this Function
|
47
|
+
* @throws SassScriptFunctionException if function is undefined
|
48
|
+
*/
|
49
|
+
public function perform() {
|
50
|
+
$name = str_replace('-', '_', $this->name);
|
51
|
+
foreach (SassScriptParser::$context->node->parser->function_paths as $path) {
|
52
|
+
$_path = explode(DIRECTORY_SEPARATOR, $path);
|
53
|
+
$_class = ucfirst($_path[sizeof($_path) - 2]);
|
54
|
+
foreach (array_slice(scandir($path), 2) as $file) {
|
55
|
+
$filename = $path . DIRECTORY_SEPARATOR . $file;
|
56
|
+
if (is_file($filename)) {
|
57
|
+
require_once($filename);
|
58
|
+
$class = 'SassExtentions'.$_class.'Functions'. ucfirst(substr($file, 0, -4));
|
59
|
+
if (method_exists($class, $name)) {
|
60
|
+
return call_user_func_array(array($class, $name), $this->args);
|
61
|
+
}
|
62
|
+
}
|
63
|
+
} // foreach
|
64
|
+
} // foreach
|
65
|
+
|
66
|
+
require_once('SassScriptFunctions.php');
|
67
|
+
if (method_exists('SassScriptFunctions', $name)) {
|
68
|
+
return call_user_func_array(array('SassScriptFunctions', $name), $this->args);
|
69
|
+
}
|
70
|
+
|
71
|
+
// CSS function: create a SassString that will emit the function into the CSS
|
72
|
+
$args = array();
|
73
|
+
foreach ($this->args as $arg) {
|
74
|
+
$args[] = $arg->toString();
|
75
|
+
}
|
76
|
+
return new SassString($this->name . '(' . join(', ', $args) . ')');
|
77
|
+
}
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Imports files in the specified directory.
|
81
|
+
* @param string path to directory to import
|
82
|
+
* @return array filenames imported
|
83
|
+
*/
|
84
|
+
private function import($dir) {
|
85
|
+
$files = array();
|
86
|
+
|
87
|
+
foreach (array_slice(scandir($dir), 2) as $file) {
|
88
|
+
if (is_file($dir . DIRECTORY_SEPARATOR . $file)) {
|
89
|
+
$files[] = $file;
|
90
|
+
require_once($dir . DIRECTORY_SEPARATOR . $file);
|
91
|
+
}
|
92
|
+
} // foreach
|
93
|
+
return $files;
|
94
|
+
}
|
95
|
+
|
96
|
+
/**
|
97
|
+
* Returns a value indicating if a token of this type can be matched at
|
98
|
+
* the start of the subject string.
|
99
|
+
* @param string the subject string
|
100
|
+
* @return mixed match at the start of the string or false if no match
|
101
|
+
*/
|
102
|
+
public static function isa($subject) {
|
103
|
+
if (!preg_match(self::MATCH, $subject, $matches))
|
104
|
+
return false;
|
105
|
+
|
106
|
+
$match = $matches[0];
|
107
|
+
$paren = 1;
|
108
|
+
$strpos = strlen($match);
|
109
|
+
$strlen = strlen($subject);
|
110
|
+
|
111
|
+
while($paren && $strpos < $strlen) {
|
112
|
+
$c = $subject[$strpos++];
|
113
|
+
|
114
|
+
$match .= $c;
|
115
|
+
if ($c === '(') {
|
116
|
+
$paren += 1;
|
117
|
+
}
|
118
|
+
elseif ($c === ')') {
|
119
|
+
$paren -= 1;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
return $match;
|
123
|
+
}
|
124
|
+
|
125
|
+
public static function extractArgs($string) {
|
126
|
+
$args = array();
|
127
|
+
$arg = '';
|
128
|
+
$paren = 0;
|
129
|
+
$strpos = 0;
|
130
|
+
$strlen = strlen($string);
|
131
|
+
|
132
|
+
while ($strpos < $strlen) {
|
133
|
+
$c = $string[$strpos++];
|
134
|
+
|
135
|
+
switch ($c) {
|
136
|
+
case '(':
|
137
|
+
$paren += 1;
|
138
|
+
$arg .= $c;
|
139
|
+
break;
|
140
|
+
case ')':
|
141
|
+
$paren -= 1;
|
142
|
+
$arg .= $c;
|
143
|
+
break;
|
144
|
+
case '"':
|
145
|
+
case "'":
|
146
|
+
$arg .= $c;
|
147
|
+
do {
|
148
|
+
$_c = $string[$strpos++];
|
149
|
+
$arg .= $_c;
|
150
|
+
} while ($_c !== $c);
|
151
|
+
break;
|
152
|
+
case ',':
|
153
|
+
if ($paren) {
|
154
|
+
$arg .= $c;
|
155
|
+
break;
|
156
|
+
}
|
157
|
+
$args[] = trim($arg);
|
158
|
+
$arg = '';
|
159
|
+
break;
|
160
|
+
default:
|
161
|
+
$arg .= $c;
|
162
|
+
break;
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
if ($arg) $args[] = trim($arg);
|
167
|
+
return $args;
|
168
|
+
}
|
169
|
+
}
|