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,268 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassBoolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
|
3
|
+
/**
|
4
|
+
* Compass extension SassScript colour stop objects and functions 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.extensions.compass.functions
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Compass extension List object.
|
14
|
+
* @package PHamlP
|
15
|
+
* @subpackage Sass.extensions.compass.functions
|
16
|
+
*/
|
17
|
+
class CompassList extends SassLiteral {
|
18
|
+
public function __construct($values) {
|
19
|
+
$this->value = $values;
|
20
|
+
}
|
21
|
+
|
22
|
+
public function getValues() {
|
23
|
+
return $this->value;
|
24
|
+
}
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Returns the type of this
|
28
|
+
* @return string the type of this
|
29
|
+
*/
|
30
|
+
protected function getTypeOf() {
|
31
|
+
return 'list';
|
32
|
+
}
|
33
|
+
|
34
|
+
public function toString() {
|
35
|
+
$values = array();
|
36
|
+
foreach ($this->value as $value) {
|
37
|
+
$values[] = $value->toString();
|
38
|
+
}
|
39
|
+
return join(', ', $values);
|
40
|
+
}
|
41
|
+
|
42
|
+
public static function isa($subject) {}
|
43
|
+
}
|
44
|
+
|
45
|
+
class CompassColourStop extends SassLiteral {
|
46
|
+
private $colour;
|
47
|
+
public $stop;
|
48
|
+
|
49
|
+
public function __construct($colour, $stop = null) {
|
50
|
+
$this->colour = $colour;
|
51
|
+
$this->stop = $stop;
|
52
|
+
}
|
53
|
+
|
54
|
+
protected function getColor() {
|
55
|
+
return $this->getColour();
|
56
|
+
}
|
57
|
+
|
58
|
+
protected function getColour() {
|
59
|
+
return $this->colour;
|
60
|
+
}
|
61
|
+
|
62
|
+
public function toString() {
|
63
|
+
$s = $this->colour->toString();
|
64
|
+
if (!empty($this->stop)) {
|
65
|
+
$s .= ' ';
|
66
|
+
if ($this->stop->isUnitless()) {
|
67
|
+
$s .= $this->stop->op_times(new SassNumber('100%'))->toString();
|
68
|
+
}
|
69
|
+
else {
|
70
|
+
$s .= $this->stop->toString();
|
71
|
+
}
|
72
|
+
}
|
73
|
+
return $s;
|
74
|
+
}
|
75
|
+
|
76
|
+
public static function isa($subject) {}
|
77
|
+
}
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Compass extension SassScript colour stops functions class.
|
81
|
+
* A collection of functions for use in SassSCript.
|
82
|
+
* @package PHamlP
|
83
|
+
* @subpackage Sass.extensions.compass.functions
|
84
|
+
*/
|
85
|
+
class SassExtentionsCompassFunctionsColourStops {
|
86
|
+
# returns color-stop() calls for use in webkit.
|
87
|
+
public static function grad_color_stops($colour_list) {
|
88
|
+
return self::grad_colour_stops($colour_list);
|
89
|
+
}
|
90
|
+
|
91
|
+
public static function grad_colour_stops($colour_list) {
|
92
|
+
SassLiteral::assertType($colour_list, 'CompassList');
|
93
|
+
self::normalize_stops($colour_list);
|
94
|
+
$v = array_reverse($colour_list->values);
|
95
|
+
$max = $v[0]->stop;
|
96
|
+
$last_value = null;
|
97
|
+
|
98
|
+
$colourStops = array();
|
99
|
+
|
100
|
+
foreach ($colour_list->values as $pos) {
|
101
|
+
# have to convert absolute units to percentages for use in colour stop functions.
|
102
|
+
$stop = $pos->stop;
|
103
|
+
if ($stop->numeratorUnits === $max->numeratorUnits) {
|
104
|
+
$stop = $stop->op_div($max)->op_times(new SassNumber('100%'));
|
105
|
+
}
|
106
|
+
# Make sure the colour stops are specified in the right order.
|
107
|
+
if ($last_value && $last_value->value > $stop->value) {
|
108
|
+
throw new SassScriptFunctionException('Colour stops must be specified in increasing order', array(), SassScriptParser::$context->node);
|
109
|
+
}
|
110
|
+
|
111
|
+
$last_value = $stop;
|
112
|
+
$colourStops[] = "colour-stop({$stop->toString()}, {$pos->colour->toString()})";
|
113
|
+
}
|
114
|
+
|
115
|
+
return new SassString(join(', ', $colourStops));
|
116
|
+
}
|
117
|
+
|
118
|
+
# returns the end position of the gradient from the colour stop
|
119
|
+
public static function grad_end_position($colourList, $radial = null) {
|
120
|
+
SassLiteral::assertType($colourList, 'CompassList');
|
121
|
+
if (is_null($radial)) {
|
122
|
+
$radial = new SassBoolean(false);
|
123
|
+
}
|
124
|
+
else {
|
125
|
+
SassLiteral::assertType($radial, 'SassBoolean');
|
126
|
+
}
|
127
|
+
return self::grad_position($colourList, new SassNumber(sizeof($colourList->values)), new SassNumber(100), $radial);
|
128
|
+
}
|
129
|
+
|
130
|
+
public static function grad_position($colourList, $index, $default, $radial = null) {
|
131
|
+
SassLiteral::assertType($colourList, 'CompassList');
|
132
|
+
if (is_null($radial)) {
|
133
|
+
$radial = new SassBoolean(false);
|
134
|
+
}
|
135
|
+
else {
|
136
|
+
SassLiteral::assertType($radial, 'SassBoolean');
|
137
|
+
}
|
138
|
+
$stop = $colourList->values[$index->value - 1]->stop;
|
139
|
+
if ($stop && $radial->value) {
|
140
|
+
$orig_stop = $stop;
|
141
|
+
if ($stop->isUnitless()) {
|
142
|
+
if ($stop->value <= 1) {
|
143
|
+
# A unitless number is assumed to be a percentage when it's between 0 and 1
|
144
|
+
$stop = $stop->op_times(new SassNumber('100%'));
|
145
|
+
}
|
146
|
+
else {
|
147
|
+
# Otherwise, a unitless number is assumed to be in pixels
|
148
|
+
$stop = $stop->op_times(new SassNumber('1px'));
|
149
|
+
}
|
150
|
+
}
|
151
|
+
|
152
|
+
if ($stop->numeratorUnits === '%' && isset($colourList->values[sizeof($colourList->values)-1]->stop) && $colourList->values[sizeof($colourList->values)-1]->stop->numeratorUnits === 'px')
|
153
|
+
$stop = $stop->op_times($colourList->values[sizeof($colourList->values)-1]->stop)->op_div(new SassNumber('100%'));
|
154
|
+
//Compass::Logger.new.record(:warning, "Webkit only supports pixels for the start and end stops for radial gradients. Got: #{orig_stop}") if stop.numerator_units != ["px"];
|
155
|
+
return $stop->op_div(new SassNumber('1'.$stop->units));
|
156
|
+
}
|
157
|
+
elseif ($stop)
|
158
|
+
return $stop;
|
159
|
+
else
|
160
|
+
return $default;
|
161
|
+
}
|
162
|
+
|
163
|
+
# takes the given position and returns a point in percentages
|
164
|
+
public static function grad_point($position) {
|
165
|
+
$position = $position->value;
|
166
|
+
if (strpos($position, ' ') !== false) {
|
167
|
+
if (preg_match('/(top|bottom|center) (left|right|center)/', $position, $matches))
|
168
|
+
$position = "{$matches[2]} {$matches[1]}";
|
169
|
+
}
|
170
|
+
else {
|
171
|
+
switch ($position) {
|
172
|
+
case 'top':
|
173
|
+
case 'bottom':
|
174
|
+
$position = "left $position";
|
175
|
+
break;
|
176
|
+
case 'left':
|
177
|
+
case 'right':
|
178
|
+
$position .= ' top';
|
179
|
+
break;
|
180
|
+
}
|
181
|
+
}
|
182
|
+
|
183
|
+
return new SassString(preg_replace(
|
184
|
+
array('/top/', '/bottom/', '/left/', '/right/', '/center/'),
|
185
|
+
array('0%', '100%', '0%', '100%', '50%'), $position
|
186
|
+
));
|
187
|
+
}
|
188
|
+
|
189
|
+
public static function color_stops() {
|
190
|
+
return self::colour_stops(func_get_args());
|
191
|
+
}
|
192
|
+
|
193
|
+
public static function colour_stops() {
|
194
|
+
$args = func_get_args();
|
195
|
+
$list = array();
|
196
|
+
|
197
|
+
foreach ($args as $arg) {
|
198
|
+
if ($arg instanceof SassColour) {
|
199
|
+
$list[] = new CompassColourStop($arg);
|
200
|
+
}
|
201
|
+
elseif ($arg instanceof SassString) {
|
202
|
+
# We get a string as the result of concatenation
|
203
|
+
# So we have to reparse the expression
|
204
|
+
$colour = $stop = null;
|
205
|
+
if (empty($parser))
|
206
|
+
$parser = new SassScriptParser();
|
207
|
+
$expr = $parser->parse($arg->value, SassScriptParser::$context);
|
208
|
+
|
209
|
+
$x = array_pop($expr);
|
210
|
+
|
211
|
+
if ($x instanceof SassColour)
|
212
|
+
$colour = $x;
|
213
|
+
elseif ($x instanceof SassScriptOperation) {
|
214
|
+
if ($x->operator != 'concat')
|
215
|
+
# This should never happen.
|
216
|
+
throw new SassScriptFunctionException("Couldn't parse a colour stop from: {value}", array('{value}'=>$arg->value), SassScriptParser::$context->node);
|
217
|
+
$colour = $expr[0];
|
218
|
+
$stop = $expr[1];
|
219
|
+
}
|
220
|
+
else
|
221
|
+
throw new SassScriptFunctionException("Couldn't parse a colour stop from: {value}", array('{value}'=>$arg->value), SassScriptParser::$context->node);
|
222
|
+
$list[] = new CompassColourStop($colour, $stop);
|
223
|
+
}
|
224
|
+
else
|
225
|
+
throw new SassScriptFunctionException('Not a valid color stop: {arg}', array('{arg}'=>$arg->value), SassScriptParser::$context->node);
|
226
|
+
}
|
227
|
+
return new CompassList($list);
|
228
|
+
}
|
229
|
+
|
230
|
+
private static function normalize_stops($colourList) {
|
231
|
+
$positions = $colourList->values;
|
232
|
+
$s = sizeof($positions);
|
233
|
+
|
234
|
+
# fill in the start and end positions, if unspecified
|
235
|
+
if (empty($positions[0]->stop))
|
236
|
+
$positions[0]->stop = new SassNumber(0);
|
237
|
+
if (empty($positions[$s-1]->stop))
|
238
|
+
$positions[$s-1]->stop = new SassNumber('100%');
|
239
|
+
|
240
|
+
# fill in empty values
|
241
|
+
for ($i = 0; $i<$s; $i++) {
|
242
|
+
if (is_null($positions[$i]->stop)) {
|
243
|
+
$num = 2;
|
244
|
+
for ($j = $i+1; $j<$s; $j++) {
|
245
|
+
if (isset($positions[$j]->stop)) {
|
246
|
+
$positions[$i]->stop = $positions[$i-1]->stop->op_plus($positions[$j]->stop->op_minus($positions[$i-1]->stop))->op_div(new SassNumber($num));
|
247
|
+
break;
|
248
|
+
}
|
249
|
+
else
|
250
|
+
$num += 1;
|
251
|
+
}
|
252
|
+
}
|
253
|
+
}
|
254
|
+
# normalize unitless numbers
|
255
|
+
foreach ($positions as &$pos) {
|
256
|
+
if ($pos->stop->isUnitless()) {
|
257
|
+
$pos->stop = ($pos->stop->value <= 1 ?
|
258
|
+
$pos->stop->op_times(new SassNumber('100%')) :
|
259
|
+
$pos->stop->op_times(new SassNumber('1px'))
|
260
|
+
);
|
261
|
+
}
|
262
|
+
}
|
263
|
+
if ($positions[$s-1]->stop->op_eq(new SassNumber('0px'))->toBoolean() ||
|
264
|
+
$positions[$s-1]->stop->op_eq(new SassNumber('0%'))->toBoolean())
|
265
|
+
throw new SassScriptFunctionException('Colour stops must be specified in increasing order', array(), SassScriptParser::$context->node);
|
266
|
+
return null;
|
267
|
+
}
|
268
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassBoolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
|
3
|
+
/**
|
4
|
+
* Compass extension SassScript constants functions 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.extensions.compass.functions
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Compass extension SassScript constants functions class.
|
14
|
+
* A collection of functions for use in SassSCript.
|
15
|
+
* @package PHamlP
|
16
|
+
* @subpackage Sass.extensions.compass.functions
|
17
|
+
*/
|
18
|
+
class SassExtentionsCompassFunctionsConstants {
|
19
|
+
public static function opposite_position($pos) {
|
20
|
+
$opposites = array();
|
21
|
+
foreach (explode(' ', $pos->toString()) as $position) {
|
22
|
+
switch (trim($position)) {
|
23
|
+
case 'top':
|
24
|
+
$opposites[] = 'bottom';
|
25
|
+
break;
|
26
|
+
case 'right':
|
27
|
+
$opposites[] = 'left';
|
28
|
+
break;
|
29
|
+
case 'bottom':
|
30
|
+
$opposites[] = 'top';
|
31
|
+
break;
|
32
|
+
case 'left':
|
33
|
+
$opposites[] = 'right';
|
34
|
+
break;
|
35
|
+
case 'center':
|
36
|
+
$opposites[] = 'center';
|
37
|
+
break;
|
38
|
+
default:
|
39
|
+
throw new Exception('Cannot determine the opposite of '.trim($position));
|
40
|
+
}
|
41
|
+
}
|
42
|
+
return new SassString(join(' ', $opposites));
|
43
|
+
}
|
44
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassBoolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
|
3
|
+
/**
|
4
|
+
* Compass extension SassScript font files functions 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.extensions.compass.functions
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Compass extension SassScript font files functions class.
|
14
|
+
* A collection of functions for use in SassSCript.
|
15
|
+
* @package PHamlP
|
16
|
+
* @subpackage Sass.extensions.compass.functions
|
17
|
+
*/
|
18
|
+
class SassExtentionsCompassFunctionsFontFiles {
|
19
|
+
public function font_files() {
|
20
|
+
if (func_num_args() % 2)
|
21
|
+
throw new SassScriptFunctionException('An even number of arguments must be passed to font_files()', array(), SassScriptParser::$context->node);
|
22
|
+
|
23
|
+
$args = func_get_args();
|
24
|
+
$files = array();
|
25
|
+
while ($args) {
|
26
|
+
$files[] = '#{font_url('.array_shift($args)."} format('".array_shift($args)."')";
|
27
|
+
}
|
28
|
+
return new SassString(join(", ", $files));
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassBoolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
|
3
|
+
/**
|
4
|
+
* Compass extension SassScript image size functions 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.extensions.compass.functions
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Compass extension SassScript image size functions class.
|
14
|
+
* A collection of functions for use in SassSCript.
|
15
|
+
* @package PHamlP
|
16
|
+
* @subpackage Sass.extensions.compass.functions
|
17
|
+
*/
|
18
|
+
class SassExtentionsCompassFunctionsImageSize {
|
19
|
+
# Returns the $width of the image relative to the images directory
|
20
|
+
public function image_width($image_file) {
|
21
|
+
$image_size = getimagesize(self::real_path($image_file));
|
22
|
+
return new SassNumber($image_size[0].'px');
|
23
|
+
}
|
24
|
+
|
25
|
+
# Returns the height of the image relative to the images directory
|
26
|
+
public function image_height($image_file) {
|
27
|
+
$image_size = getimagesize(self::real_path($image_file));
|
28
|
+
return new SassNumber($image_size[1].'px');
|
29
|
+
}
|
30
|
+
|
31
|
+
private function real_path($image_file) {
|
32
|
+
$path = $image_file->value;
|
33
|
+
# Compute the real path to the image on the file stystem if the images_dir is set.
|
34
|
+
if (SassExtentionsCompassConfig::config('images_path'))
|
35
|
+
return SassExtentionsCompassConfig::config('images_path').DIRECTORY_SEPARATOR.$path;
|
36
|
+
else
|
37
|
+
return SassExtentionsCompassConfig::config('project_path').DIRECTORY_SEPARATOR.$path;
|
38
|
+
}
|
39
|
+
}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassBoolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
|
3
|
+
/**
|
4
|
+
* Compass extension SassScript inline data 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.extensions.compass.functions
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Compass extension SassScript inline data functions class.
|
14
|
+
* A collection of functions for use in SassSCript.
|
15
|
+
* @package PHamlP
|
16
|
+
* @subpackage Sass.extensions.compass.functions
|
17
|
+
*/
|
18
|
+
class SassExtentionsCompassFunctionsInlineData {
|
19
|
+
public function inline_image($path, $mime_type = null) {
|
20
|
+
$path = $path->value;
|
21
|
+
$real_path = SassExtentionsCompassConfig::config('images_path').DIRECTORY_SEPARATOR.$path;
|
22
|
+
$url = 'url(data:'.self::compute_mime_type($path, $mime_type).';base64,'.self::data($real_path).')';
|
23
|
+
return new SassString($url);
|
24
|
+
}
|
25
|
+
|
26
|
+
public function inline_font_files() {
|
27
|
+
if (func_num_args() % 2)
|
28
|
+
throw new SassScriptFunctionException('An even number of arguments must be passed to inline_font_files()', array(), SassScriptParser::$context->node);
|
29
|
+
|
30
|
+
$args = func_get_args();
|
31
|
+
$files = array();
|
32
|
+
while ($args) {
|
33
|
+
$path = array_shift($args);
|
34
|
+
$real_path = SassExtentionsCompassConfig::config('fonts_path').DIRECTORY_SEPARATOR.$path->value;
|
35
|
+
$fp = fopen($real_path, 'rb');
|
36
|
+
$url = 'url(data:'.self::compute_mime_type($path).';base64,'.self::data($real_path).')';
|
37
|
+
$files[] = "$url format('".array_shift($args)."')";
|
38
|
+
}
|
39
|
+
return new SassString(join(", ", $files));
|
40
|
+
}
|
41
|
+
|
42
|
+
private function compute_mime_type($path, $mime_type = null) {
|
43
|
+
if ($mime_type) return $mime_type;
|
44
|
+
|
45
|
+
switch (true) {
|
46
|
+
case preg_match('/\.png$/i', $path):
|
47
|
+
return 'image/png';
|
48
|
+
break;
|
49
|
+
case preg_match('/\.jpe?g$/i', $path):
|
50
|
+
return 'image/jpeg';
|
51
|
+
break;
|
52
|
+
case preg_match('/\.gif$/i', $path):
|
53
|
+
return 'image/gif';
|
54
|
+
break;
|
55
|
+
case preg_match('/\.otf$/i', $path):
|
56
|
+
return 'font/opentype';
|
57
|
+
break;
|
58
|
+
case preg_match('/\.ttf$/i', $path):
|
59
|
+
return 'font/truetype';
|
60
|
+
break;
|
61
|
+
case preg_match(' /\.woff$/i', $path):
|
62
|
+
return 'font/woff';
|
63
|
+
break;
|
64
|
+
case preg_match(' /\.off$/i', $path):
|
65
|
+
return 'font/openfont';
|
66
|
+
break;
|
67
|
+
case preg_match('/\.([a-zA-Z]+)$/i', $path, $matches):
|
68
|
+
return 'image/'.strtolower($matches[1]);
|
69
|
+
break;
|
70
|
+
default:
|
71
|
+
throw new SassScriptFunctionException('Unable to determine mime type for {what}, please specify one explicitly', array('{what}'=>$path), SassScriptParser::$context->node);
|
72
|
+
break;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
private function data($real_path) {
|
77
|
+
if (file_exists($real_path)) {
|
78
|
+
$fp = fopen($real_path, 'rb');
|
79
|
+
return base64_encode(fread($fp, filesize($real_path)));
|
80
|
+
}
|
81
|
+
else
|
82
|
+
throw new SassScriptFunctionException('Unable to find {what}: {filename}', array('{what}'=>'file', '{filename}'=>$real_path), SassScriptParser::$context->node);
|
83
|
+
}
|
84
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassBoolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
|
3
|
+
/**
|
4
|
+
* Compass extension SassScript lists functions 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.extensions.compass.functions
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Compass extension SassScript lists functions class.
|
14
|
+
* A collection of functions for use in SassSCript.
|
15
|
+
* @package PHamlP
|
16
|
+
* @subpackage Sass.extensions.compass.functions
|
17
|
+
*/
|
18
|
+
class SassExtentionsCompassFunctionsLists {
|
19
|
+
const SPACE_SEPARATOR = '/\s+/';
|
20
|
+
|
21
|
+
# Return the first value from a space separated list.
|
22
|
+
public static function first_value_of($list) {
|
23
|
+
if ($list instanceof SassString) {
|
24
|
+
$items = preg_split(self::SPACE_SEPARATOR, $list->value);
|
25
|
+
return new SassString($items[0]);
|
26
|
+
}
|
27
|
+
else return $list;
|
28
|
+
}
|
29
|
+
|
30
|
+
# Return the nth value from a space separated list.
|
31
|
+
public static function nth_value_of($list, $n) {
|
32
|
+
if ($list instanceof SassString) {
|
33
|
+
$items = preg_split(self::SPACE_SEPARATOR, $list->value);
|
34
|
+
return new SassString($items[$n->toInt()-1]);
|
35
|
+
}
|
36
|
+
else return $list;
|
37
|
+
}
|
38
|
+
|
39
|
+
# Return the last value from a space separated list.
|
40
|
+
public static function last_value_of($list) {
|
41
|
+
if ($list instanceof SassString) {
|
42
|
+
$items = array_reverse(preg_split(self::SPACE_SEPARATOR, $list->value));
|
43
|
+
return new SassString($items[0]);
|
44
|
+
}
|
45
|
+
else return $list;
|
46
|
+
}
|
47
|
+
}
|
@@ -0,0 +1,128 @@
|
|
1
|
+
<?php
|
2
|
+
/* SVN FILE: $Id: SassBoolean.php 49 2010-04-04 10:51:24Z chris.l.yates $ */
|
3
|
+
/**
|
4
|
+
* Compass extension SassScript selectors functions 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.extensions.compass.functions
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Compass extension SassScript selectors functions class.
|
14
|
+
* A collection of functions for use in SassSCript.
|
15
|
+
* @package PHamlP
|
16
|
+
* @subpackage Sass.extensions.compass.functions
|
17
|
+
*/
|
18
|
+
class SassExtentionsCompassFunctionsSelectors {
|
19
|
+
const COMMA_SEPARATOR = '/\s*,\s*/';
|
20
|
+
|
21
|
+
private static $defaultDisplay = array(
|
22
|
+
'block' => array('address', 'blockquote', 'center', 'dir', 'div', 'dd',
|
23
|
+
'dl', 'dt', 'fieldset', 'form', 'frameset h1', 'h2', 'h3', 'h4', 'h5',
|
24
|
+
'h6', 'hr', 'isindex', 'menu', 'noframes', 'noscript', 'ol', 'p', 'pre',
|
25
|
+
'ul'),
|
26
|
+
'inline' => array('a', 'abbr', 'acronym', 'b', 'basefont', 'bdo', 'big',
|
27
|
+
'br', 'cite', 'code', 'dfn', 'em', 'font', 'i', 'img', 'input', 'kbd',
|
28
|
+
'label', 'q', 's', 'samp', 'select', 'small', 'span', 'strike', 'strong',
|
29
|
+
'sub', 'sup', 'textarea', 'tt', 'u', 'var'),
|
30
|
+
'table' => array('table'),
|
31
|
+
'list-item' => array('li'),
|
32
|
+
'table-row-group' => array('tbody'),
|
33
|
+
'table-header-group' => array('thead'),
|
34
|
+
'table-footer-group' => array('tfoot'),
|
35
|
+
'table-row' => array('tr'),
|
36
|
+
'table-cell' => array('th', 'td')
|
37
|
+
);
|
38
|
+
|
39
|
+
# Permute multiple selectors each of which may be comma delimited, the end result is
|
40
|
+
# a new selector that is the equivalent of nesting each under the previous selector.
|
41
|
+
# To illustrate, the following mixins are equivalent:
|
42
|
+
# =mixin-a($selector1, $selector2, $selector3)
|
43
|
+
# #{$selector1}
|
44
|
+
# #{$selector2}
|
45
|
+
# #{$selector3}
|
46
|
+
# width: 2px
|
47
|
+
# =mixin-b($selector1, $selector2, $selector3)
|
48
|
+
# #{nest($selector, $selector2, $selector3)}
|
49
|
+
# width: 2px
|
50
|
+
public static function nest() {
|
51
|
+
if (func_num_args() < 2)
|
52
|
+
throw new SassScriptFunctionException('nest() requires two or more arguments', array(), SassScriptParser::$context->node);
|
53
|
+
|
54
|
+
$args = func_get_args();
|
55
|
+
$arg = array_shift($args);
|
56
|
+
$ancestors = preg_split(self::COMMA_SEPARATOR, $arg->value);
|
57
|
+
|
58
|
+
foreach ($args as $arg) {
|
59
|
+
$nested = array();
|
60
|
+
foreach (preg_split(self::COMMA_SEPARATOR, $arg->value) as $descenant) {
|
61
|
+
foreach ($ancestors as $ancestor) {
|
62
|
+
$nested[] = "$ancestor $descenant";
|
63
|
+
}
|
64
|
+
}
|
65
|
+
$ancestors = $nested;
|
66
|
+
}
|
67
|
+
sort($nested);
|
68
|
+
return new SassString(join(', ', $nested));
|
69
|
+
}
|
70
|
+
|
71
|
+
# Permute two selectors, the first may be comma delimited.
|
72
|
+
# The end result is a new selector that is the equivalent of nesting the second
|
73
|
+
# selector under the first one in a sass file and preceding it with an &.
|
74
|
+
# To illustrate, the following mixins are equivalent:
|
75
|
+
# =mixin-a($selector, $to_append)
|
76
|
+
# #{$selector}
|
77
|
+
# &#{$to_append}
|
78
|
+
# width: 2px
|
79
|
+
# =mixin-b($selector, $to_append)
|
80
|
+
# #{append_selector($selector, $to_append)}
|
81
|
+
# width: 2px
|
82
|
+
public static function append_selector($selector, $to_append) {
|
83
|
+
$appended = array();
|
84
|
+
foreach (preg_split(self::COMMA_SEPARATOR, $selector->value) as $ancestor) {
|
85
|
+
foreach (preg_split(self::COMMA_SEPARATOR, $to_append->value) as $descendant) {
|
86
|
+
$appended[] = $ancestor.$descendant;
|
87
|
+
}
|
88
|
+
}
|
89
|
+
return new SassString(join(', ', $appended));
|
90
|
+
}
|
91
|
+
|
92
|
+
# Return the header selectors for the levels indicated
|
93
|
+
# Defaults to all headers h1 through h6
|
94
|
+
# For example:
|
95
|
+
# headers(all) => h1, h2, h3, h4, h5, h6
|
96
|
+
# headers(4) => h1, h2, h3, h4
|
97
|
+
# headers(2,4) => h2, h3, h4
|
98
|
+
public static function headers($from = null, $to = null) {
|
99
|
+
if (!$from || ($from instanceof SassString && $from->value === "all")) {
|
100
|
+
$from = new SassNumber(1);
|
101
|
+
$to = new SassNumber(6);
|
102
|
+
}
|
103
|
+
elseif ($from && !$to) {
|
104
|
+
$to = $from;
|
105
|
+
$from = new SassNumber(1);
|
106
|
+
}
|
107
|
+
|
108
|
+
return new SassString('h' . join(', h', range($from->value, $to->value)));
|
109
|
+
}
|
110
|
+
|
111
|
+
public static function headings($from = null, $to = null) {
|
112
|
+
return self::headers($from, $to);
|
113
|
+
}
|
114
|
+
|
115
|
+
# Return an enumerated set of comma separated selectors.
|
116
|
+
# For example
|
117
|
+
# enumerate('foo', 1, 4) => foo-1, foo-2, foo-3, foo-4
|
118
|
+
public static function enumerate($prefix, $from, $to, $separator = null) {
|
119
|
+
$_prefix = $prefix->value . (!$separator ? '-' : $separator->value);
|
120
|
+
return new SassString($_prefix . join(', '.$_prefix, range($from->value, $to->value)));
|
121
|
+
}
|
122
|
+
|
123
|
+
# returns a comma delimited string for all the
|
124
|
+
# elements according to their default css3 display value.
|
125
|
+
public static function elements_of_type($display) {
|
126
|
+
return new SassString(join(', ', self::$defaultDisplay[$display->value]));
|
127
|
+
}
|
128
|
+
}
|