$wrapper_height = 50% .wrapper height $wrapper_height + 20px top ($wrapper_height / 2)
.object color #a50c5b - 50sat /* decrease saturation by 50% */ background-color #a50c5b + 50lt /* make color lighter by 50 percent */
@mixin filter-grayscale(percent) -webkit-filter: grayscale($percent); -ms-filter: grayscale($percent); -o-filter: grayscale($percent); filter: grayscale($percent); img filter-grayscale 100% img:hover filter-grayscale 0%
@mixin border-radius(topleft, topright) -webkit-border-radius $topleft $topright 4px 5px border-radius $arguments
html height 0 width 50px !prefixWith(ms, moz) !important border-radius 5px !important filter-grayscale 50% transform scale(2)
html { height: 0; -ms-width: 50px !important; -moz-width: 50px !important; width: 50px !important; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; -webkit-filter: grayscale(50%); filter: grayscale(50%); -ms-transform: scale(2); -moz-transform: scale(2); -o-transform: scale(2); -webkit-transform: scale(2); transform: scale(2) }
html { color red; text-align: center; margin: 0 auto; } @mixin rounded-corners (top, right, bottom, left) -webkit-border-radius \$left + \$right \$top + \$bottom -moz-border-radius \$arguments border-radius \$arguments \$left \$right \$left \$right @mixin diagonal-border-radius(left, right) border-radius \$arguments \$right \$left @page padding 5px body rounded-corners 1 2 3 4 .wrapper diagonal-border-radius 6px 10px h1 span color blue
<?php try { $result = $mysheet->parseCode($code); $compiledCode = $result->toRealCss(); } catch (\MSSLib\Error\MySheetException $ex) { echo($ex->getTraceAsString()); }
object (MSSLib \ Structure \ Document) [64] protected '_docFilePath' => null protected 'children' => array (size = 5) 0 => object (MSSLib \ Structure \ Ruleset) [98] private '_selectors' => array (size = 1) 0 => object (MSSLib \ Structure \ Selector) [99] private '_mssPath' => string 'html' (length = 4) private '_cssPathGroup' => object (MSSLib \ Structure \ CssSelectorGroup) [180] private 'paths' => array (size = 1) 0 => string 'html' (length = 4) private '_ruleset' => & object (MSSLib \ Structure \ Ruleset) [98] private '_isFullSelector' => null private '_isParsed' => boolean true private '_handlerMap' => null protected '_parentRuleset' => null protected 'children' => array (size = 3) 0 => object (MSSLib \ Structure \ Declaration) [100] private 'ruleName' => string 'color' (length = 5) private 'ruleValue' => object (MSSLib \ Structure \ RuleValue) [101] private 'params' => array (size = 1) 0 => object (MSSLib \ EmbeddedClasses \ ColorClass) [104] protected 'type' => string 'html' (length = 4) protected 'color' => array (size = 1) 0 => string 'red' (length = 3) protected '_colorLib' => null private '_parentDeclaration' => & object (MSSLib \ Structure \ Declaration) [100] private '_flags' => array (size = 0) empty private 'ruleEnabled' => boolean true private 'parent' (MSSLib \ Structure \ Block) => null private '_handlerMap' => null private '_handlerMap' (MSSLib \ Structure \ Block) => null 1 => object (MSSLib \ Structure \ Declaration) [102] private 'ruleName' => string 'text-align' (length = 10) private 'ruleValue' => object (MSSLib \ Structure \ RuleValue) [103] private 'params' => array (size = 1) 0 => object (MSSLib \ EmbeddedClasses \ NonQuotedStringClass) [107] protected 'text' => string 'center' (length = 6) private '_parentDeclaration' => & object (MSSLib \ Structure \ Declaration) [102] private '_flags' => array (size = 0) empty private 'ruleEnabled' => boolean true private 'parent' (MSSLib \ Structure \ Block) => null private '_handlerMap' => null private '_handlerMap' (MSSLib \ Structure \ Block) => null 2 => object (MSSLib \ Structure \ Declaration) [105] private 'ruleName' => string 'margin' (length = 6) private 'ruleValue' => object (MSSLib \ Structure \ RuleValue) [106] private 'params' => array (size = 2) 0 => object (MSSLib \ EmbeddedClasses \ MetricClass) [110] protected 'metric' => float 0 protected 'unit' => null 1 => object (MSSLib \ EmbeddedClasses \ NonQuotedStringClass) [111] protected 'text' => string 'auto' (length = 4) private '_parentDeclaration' => & object (MSSLib \ Structure \ Declaration) [105] private '_flags' => array (size = 0) empty private 'ruleEnabled' => boolean true private 'parent' (MSSLib \ Structure \ Block) => null private '_handlerMap' => null private '_handlerMap' (MSSLib \ Structure \ Block) => null private 'parent' (MSSLib \ Structure \ Block) => & object (MSSLib \ Structure \ Document) [64] private '_handlerMap' (MSSLib \ Structure \ Block) => null 1 => object (MSSLib \ Plugins \ Mixin \ Mixin) [97] protected 'name' => string 'rounded-corners' (length = 15) protected 'locals' => array (size = 4) 0 => string 'top' (length = 3) 1 => string 'right' (length = 5) 2 => string 'bottom' (length = 6) 3 => string 'left' (length = 4) protected 'children' => array (size = 3) 0 => object (MSSLib \ Structure \ Declaration) [109] private 'ruleName' => string '-webkit-border-radius' (length = 21) private 'ruleValue' => object (MSSLib \ Structure \ RuleValue) [113] private 'params' => array (size = 2) 0 => object (MSSLib \ EmbeddedClasses \ MathExprClass) [122] protected 'expressionTree' => object (MSSLib \ Essentials \ ExpressionTree \ ExpressionNode) [116] private 'value' (Tree \ Node \ Node) => null private 'parent' (Tree \ Node \ Node) => null private 'children' (Tree \ Node \ Node) => array (size = 3) 0 => object (MSSLib \ Essentials \ ExpressionTree \ ParamNode) [117] private 'value' (Tree \ Node \ Node) => object (MSSLib \ EmbeddedClasses \ VariableClass) [119] private 'varName' => string 'left' (length = 4) private 'parent' (Tree \ Node \ Node) => & object (MSSLib \ Essentials \ ExpressionTree \ ExpressionNode) [116] private 'children' (Tree \ Node \ Node) => array (size = 0) empty 1 => object (MSSLib \ Essentials \ ExpressionTree \ OperatorNode) [118] private 'value' (Tree \ Node \ Node) => object (MSSLib \ Operators \ PlusOperator) [120] private 'parent' (Tree \ Node \ Node) => & object (MSSLib \ Essentials \ ExpressionTree \ ExpressionNode) [116] private 'children' (Tree \ Node \ Node) => array (size = 0) empty 2 => object (MSSLib \ Essentials \ ExpressionTree \ ParamNode) [121] private 'value' (Tree \ Node \ Node) => object (MSSLib \ EmbeddedClasses \ VariableClass) [123] private 'varName' => string 'right' (length = 5) private 'parent' (Tree \ Node \ Node) => & object (MSSLib \ Essentials \ ExpressionTree \ ExpressionNode) [116] private 'children' (Tree \ Node \ Node) => array (size = 0) empty 1 => object (MSSLib \ EmbeddedClasses \ MathExprClass) [130] protected 'expressionTree' => object (MSSLib \ Essentials \ ExpressionTree \ ExpressionNode) [124] private 'value' (Tree \ Node \ Node) => null private 'parent' (Tree \ Node \ Node) => null private 'children' (Tree \ Node \ Node) => array (size = 3) 0 => object (MSSLib \ Essentials \ ExpressionTree \ ParamNode) [125] private 'value' (Tree \ Node \ Node) => object (MSSLib \ EmbeddedClasses \ VariableClass) [127] private 'varName' => string 'top' (length = 3) private 'parent' (Tree \ Node \ Node) => & object (MSSLib \ Essentials \ ExpressionTree \ ExpressionNode) [124] private 'children' (Tree \ Node \ Node) => array (size = 0) empty 1 => object (MSSLib \ Essentials \ ExpressionTree \ OperatorNode) [126] private 'value' (Tree \ Node \ Node) => object (MSSLib \ Operators \ PlusOperator) [128] private 'parent' (Tree \ Node \ Node) => & object (MSSLib \ Essentials \ ExpressionTree \ ExpressionNode) [124] private 'children' (Tree \ Node \ Node) => array (size = 0) empty 2 => object (MSSLib \ Essentials \ ExpressionTree \ ParamNode) [129] private 'value' (Tree \ Node \ Node) => object (MSSLib \ EmbeddedClasses \ VariableClass) [131] private 'varName' => string 'bottom' (length = 6) private 'parent' (Tree \ Node \ Node) => & object (MSSLib \ Essentials \ ExpressionTree \ ExpressionNode) [124] private 'children' (Tree \ Node \ Node) => array (size = 0) empty private '_parentDeclaration' => & object (MSSLib \ Structure \ Declaration) [109] private '_flags' => array (size = 0) empty private 'ruleEnabled' => boolean true private 'parent' (MSSLib \ Structure \ Block) => null private '_handlerMap' => null private '_handlerMap' (MSSLib \ Structure \ Block) => null 1 => object (MSSLib \ Structure \ Declaration) [114] private 'ruleName' => string '-moz-border-radius' (length = 18) private 'ruleValue' => object (MSSLib \ Structure \ RuleValue) [115] private 'params' => array (size = 1) 0 => object (MSSLib \ EmbeddedClasses \ VariableClass) [134] private 'varName' => string 'arguments' (length = 9) private '_parentDeclaration' => & object (MSSLib \ Structure \ Declaration) [114] private '_flags' => array (size = 0) empty private 'ruleEnabled' => boolean true private 'parent' (MSSLib \ Structure \ Block) => null private '_handlerMap' => null private '_handlerMap' (MSSLib \ Structure \ Block) => null 2 => object (MSSLib \ Structure \ Declaration) [132] private 'ruleName' => string 'border-radius' (length = 13) private 'ruleValue' => object (MSSLib \ Structure \ RuleValue) [133] private 'params' => array (size = 5) 0 => object (MSSLib \ EmbeddedClasses \ VariableClass) [137] private 'varName' => string 'arguments' (length = 9) 1 => object (MSSLib \ EmbeddedClasses \ VariableClass) [138] private 'varName' => string 'left' (length = 4) 2 => object (MSSLib \ EmbeddedClasses \ VariableClass) [139] private 'varName' => string 'right' (length = 5) 3 => object (MSSLib \ EmbeddedClasses \ VariableClass) [140] private 'varName' => string 'left' (length = 4) 4 => object (MSSLib \ EmbeddedClasses \ VariableClass) [141] private 'varName' => string 'right' (length = 5) private '_parentDeclaration' => & object (MSSLib \ Structure \ Declaration) [132] private '_flags' => array (size = 0) empty private 'ruleEnabled' => boolean true private 'parent' (MSSLib \ Structure \ Block) => null private '_handlerMap' => null private '_handlerMap' (MSSLib \ Structure \ Block) => null private 'parent' (MSSLib \ Structure \ Block) => & object (MSSLib \ Structure \ Document) [64] private '_handlerMap' (MSSLib \ Structure \ Block) => null protected 'plugin' => object (MSSLib \ Plugins \ Mixin \ PluginMixin) [58] private '_registeredMixins' => array (size = 0) empty private '_systemMixins' => array (size = 3) 'border-radius' => array (size = 2) 0 => object (MSSLib \ Plugins \ Mixin \ EmbeddedMixins \ BasicSet) [61] 1 => string 'border_radius' (length = 13) 'transform' => array (size = 2) 0 => object (MSSLib \ Plugins \ Mixin \ EmbeddedMixins \ BasicSet) [61] 1 => string 'transform' (length = 9) 'filter-grayscale' => array (size = 2) 0 => object (MSSLib \ Plugins \ Mixin \ EmbeddedMixins \ BasicSet) [61] 1 => string 'filter_grayscale' (length = 16) protected '_enabledMixinSetClasses' => array (size = 1) 0 => string 'basic' (length = 5) 2 => object (MSSLib \ Plugins \ Mixin \ Mixin) [112] protected 'name' => string 'diagonal-border-radius' (length = 22) protected 'locals' => array (size = 2) 0 => string 'left' (length = 4) 1 => string 'right' (length = 5) protected 'children' => array (size = 1) 0 => object (MSSLib \ Structure \ Declaration) [136] private 'ruleName' => string 'border-radius' (length = 13) private 'ruleValue' => object (MSSLib \ Structure \ RuleValue) [142] private 'params' => array (size = 3) 0 => object (MSSLib \ EmbeddedClasses \ VariableClass) [145] private 'varName' => string 'arguments' (length = 9) 1 => object (MSSLib \ EmbeddedClasses \ VariableClass) [146] private 'varName' => string 'right' (length = 5) 2 => object (MSSLib \ EmbeddedClasses \ VariableClass) [147] private 'varName' => string 'left' (length = 4) private '_parentDeclaration' => & object (MSSLib \ Structure \ Declaration) [136] private '_flags' => array (size = 0) empty private 'ruleEnabled' => boolean true private 'parent' (MSSLib \ Structure \ Block) => null private '_handlerMap' => null private '_handlerMap' (MSSLib \ Structure \ Block) => null private 'parent' (MSSLib \ Structure \ Block) => & object (MSSLib \ Structure \ Document) [64] private '_handlerMap' (MSSLib \ Structure \ Block) => null protected 'plugin' => object (MSSLib \ Plugins \ Mixin \ PluginMixin) [58] private '_registeredMixins' => array (size = 0) empty private '_systemMixins' => array (size = 3) 'border-radius' => array (size = 2) 0 => object (MSSLib \ Plugins \ Mixin \ EmbeddedMixins \ BasicSet) [61] 1 => string 'border_radius' (length = 13) 'transform' => array (size = 2) 0 => object (MSSLib \ Plugins \ Mixin \ EmbeddedMixins \ BasicSet) [61] 1 => string 'transform' (length = 9) 'filter-grayscale' => array (size = 2) 0 => object (MSSLib \ Plugins \ Mixin \ EmbeddedMixins \ BasicSet) [61] 1 => string 'filter_grayscale' (length = 16) protected '_enabledMixinSetClasses' => array (size = 1) 0 => string 'basic' (length = 5) 3 => object (MSSLib \ Structure \ AtRule) [135] protected '_name' => string 'page' (length = 4) protected '_parameters' => string '' (length = 0) protected 'children' => array (size = 1) 0 => object (MSSLib \ Structure \ Declaration) [143] private 'ruleName' => string 'padding' (length = 7) private 'ruleValue' => object (MSSLib \ Structure \ RuleValue) [148] private 'params' => array (size = 1) 0 => object (MSSLib \ EmbeddedClasses \ MetricClass) [151] protected 'metric' => float 5 protected 'unit' => string 'px' (length = 2) private '_parentDeclaration' => & object (MSSLib \ Structure \ Declaration) [143] private '_flags' => array (size = 0) empty private 'ruleEnabled' => boolean true private 'parent' (MSSLib \ Structure \ Block) => & object (MSSLib \ Structure \ AtRule) [135] private '_handlerMap' => null private '_handlerMap' (MSSLib \ Structure \ Block) => null private 'parent' (MSSLib \ Structure \ Block) => & object (MSSLib \ Structure \ Document) [64] private '_handlerMap' (MSSLib \ Structure \ Block) => null 4 => object (MSSLib \ Structure \ Ruleset) [144] private '_selectors' => array (size = 1) 0 => object (MSSLib \ Structure \ Selector) [150] private '_mssPath' => string 'body' (length = 4) private '_cssPathGroup' => object (MSSLib \ Structure \ CssSelectorGroup) [96] private 'paths' => array (size = 1) 0 => string 'body' (length = 4) private '_ruleset' => & object (MSSLib \ Structure \ Ruleset) [144] private '_isFullSelector' => null private '_isParsed' => boolean true private '_handlerMap' => null protected '_parentRuleset' => null protected 'children' => array (size = 3) 0 => object (MSSLib \ Structure \ Declaration) [152] private 'ruleName' => string 'rounded-corners' (length = 15) private 'ruleValue' => object (MSSLib \ Structure \ RuleValue) [153] private 'params' => array (size = 4) 0 => object (MSSLib \ EmbeddedClasses \ MetricClass) [156] protected 'metric' => float 1 protected 'unit' => null 1 => object (MSSLib \ EmbeddedClasses \ MetricClass) [157] protected 'metric' => float 2 protected 'unit' => null 2 => object (MSSLib \ EmbeddedClasses \ MetricClass) [158] protected 'metric' => float 3 protected 'unit' => null 3 => object (MSSLib \ EmbeddedClasses \ MetricClass) [159] protected 'metric' => float 4 protected 'unit' => null private '_parentDeclaration' => & object (MSSLib \ Structure \ Declaration) [152] private '_flags' => array (size = 0) empty private 'ruleEnabled' => boolean true private 'parent' (MSSLib \ Structure \ Block) => null private '_handlerMap' => null private '_handlerMap' (MSSLib \ Structure \ Block) => null 1 => object (MSSLib \ Structure \ Declaration) [154] private 'ruleName' => string 'transform' (length = 9) private 'ruleValue' => object (MSSLib \ Structure \ RuleValue) [155] private 'params' => array (size = 1) 0 => object (MSSLib \ EmbeddedClasses \ FunctionClass) [167] protected 'name' => string 'rotate' (length = 6) protected 'arguments' => array (size = 1) 0 => object (MSSLib \ EmbeddedClasses \ MathExprClass) [174] protected 'expressionTree' => object (MSSLib \ Essentials \ ExpressionTree \ ExpressionNode) [170] private 'value' (Tree \ Node \ Node) => null private 'parent' (Tree \ Node \ Node) => null private 'children' (Tree \ Node \ Node) => array (size = 2) 0 => object (MSSLib \ Essentials \ ExpressionTree \ OperatorNode) [171] private 'value' (Tree \ Node \ Node) => object (MSSLib \ Operators \ UnaryMinusOperator) [172] private 'parent' (Tree \ Node \ Node) => & object (MSSLib \ Essentials \ ExpressionTree \ ExpressionNode) [170] private 'children' (Tree \ Node \ Node) => array (size = 0) empty 1 => object (MSSLib \ Essentials \ ExpressionTree \ ParamNode) [173] private 'value' (Tree \ Node \ Node) => object (MSSLib \ EmbeddedClasses \ MetricClass) [175] protected 'metric' => float 5 protected 'unit' => string 'deg' (length = 3) private 'parent' (Tree \ Node \ Node) => & object (MSSLib \ Essentials \ ExpressionTree \ ExpressionNode) [170] private 'children' (Tree \ Node \ Node) => array (size = 0) empty protected '_functionRenderer' => object (MSSLib \ Essentials \ FunctionRenderers \ DefaultFunctionRenderer) [166] private '_parentDeclaration' => & object (MSSLib \ Structure \ Declaration) [154] private '_flags' => array (size = 0) empty private 'ruleEnabled' => boolean true private 'parent' (MSSLib \ Structure \ Block) => null private '_handlerMap' => null private '_handlerMap' (MSSLib \ Structure \ Block) => null 2 => object (MSSLib \ Structure \ Ruleset) [149] private '_selectors' => array (size = 1) 0 => object (MSSLib \ Structure \ Selector) [161] private '_mssPath' => string '.wrapper' (length = 8) private '_cssPathGroup' => object (MSSLib \ Structure \ CssSelectorGroup) [176] private 'paths' => array (size = 1) 0 => string 'body .wrapper' (length = 13) private '_ruleset' => & object (MSSLib \ Structure \ Ruleset) [149] private '_isFullSelector' => null private '_isParsed' => boolean true private '_handlerMap' => null protected '_parentRuleset' => & object (MSSLib \ Structure \ Ruleset) [144] protected 'children' => array (size = 2) 0 => object (MSSLib \ Structure \ Declaration) [168] private 'ruleName' => string 'diagonal-border-radius' (length = 22) private 'ruleValue' => object (MSSLib \ Structure \ RuleValue) [169] private 'params' => array (size = 2) 0 => object (MSSLib \ EmbeddedClasses \ MetricClass) [178] protected 'metric' => float 6 protected 'unit' => string 'px' (length = 2) 1 => object (MSSLib \ EmbeddedClasses \ MetricClass) [179] protected 'metric' => float 10 protected 'unit' => string 'px' (length = 2) private '_parentDeclaration' => & object (MSSLib \ Structure \ Declaration) [168] private '_flags' => array (size = 0) empty private 'ruleEnabled' => boolean true private 'parent' (MSSLib \ Structure \ Block) => null private '_handlerMap' => null private '_handlerMap' (MSSLib \ Structure \ Block) => null 1 => object (MSSLib \ Structure \ Ruleset) [164] private '_selectors' => array (size = 1) 0 => object (MSSLib \ Structure \ Selector) [177] private '_mssPath' => string 'h1 span' (length = 7) private '_cssPathGroup' => object (MSSLib \ Structure \ CssSelectorGroup) [183] private 'paths' => array (size = 1) 0 => string 'body .wrapper h1 span' (length = 21) private '_ruleset' => & object (MSSLib \ Structure \ Ruleset) [164] private '_isFullSelector' => null private '_isParsed' => boolean true private '_handlerMap' => null protected '_parentRuleset' => & object (MSSLib \ Structure \ Ruleset) [149] protected 'children' => array (size = 1) 0 => object (MSSLib \ Structure \ Declaration) [181] private 'ruleName' => string 'color' (length = 5) private 'ruleValue' => object (MSSLib \ Structure \ RuleValue) [182] private 'params' => array (size = 1) 0 => object (MSSLib \ EmbeddedClasses \ ColorClass) [185] protected 'type' => string 'html' (length = 4) protected 'color' => array (size = 1) 0 => string 'blue' (length = 4) protected '_colorLib' => null private '_parentDeclaration' => & object (MSSLib \ Structure \ Declaration) [181] private '_flags' => array (size = 0) empty private 'ruleEnabled' => boolean true private 'parent' (MSSLib \ Structure \ Block) => null private '_handlerMap' => null private '_handlerMap' (MSSLib \ Structure \ Block) => null private 'parent' (MSSLib \ Structure \ Block) => & object (MSSLib \ Structure \ Ruleset) [149] private '_handlerMap' (MSSLib \ Structure \ Block) => null private 'parent' (MSSLib \ Structure \ Block) => & object (MSSLib \ Structure \ Ruleset) [144] private '_handlerMap' (MSSLib \ Structure \ Block) => null private 'parent' (MSSLib \ Structure \ Block) => & object (MSSLib \ Structure \ Document) [64] private '_handlerMap' (MSSLib \ Structure \ Block) => null private 'parent' (MSSLib \ Structure \ Block) => null private '_handlerMap' (MSSLib \ Structure \ Block) => null
html { color: #ff0000; text-align: center; margin: 0 auto } @page { padding: 5px } body { -webkit-border-radius: 6 4; -moz-border-radius: 1 2 3 4; border-radius: 1 2 3 4 4 2 4 2; -ms-transform: rotate(-5deg); -moz-transform: rotate(-5deg); -o-transform: rotate(-5deg); -webkit-transform: rotate(-5deg); transform: rotate(-5deg) } body .wrapper { border-radius: 6px 10px 10px 6px } body .wrapper h1 span { color: #0000ff }
$mysheet = MySheet::Instance(); $mysheet->setActiveDirectory(realpath('./')); $mysheet->getAutoload()->registerAutoload(); $settings = new MSSettings(); $settings->set('cssRenderer', [ 'prefixRule' => ' ', 'suffixRule' => ' /* this is a real CSS rule */', 'sepSelectors' => ', ', 'sepRules' => '; ', 'prefixOCB' => ' ', 'suffixOCB' => "\n", 'prefixCCB' => "\n", 'suffixCCB' => '' ]); … $mysheet->init($settings);
Title | Default value | Description |
---|---|---|
prefixRule | 4 spaces | String inserted before each rule |
suffixRule | Empty line | String inserted after each rule |
sepSelectors | , | Separator between selectors |
sepRules | ; \ n | Separator between rules |
prefixOCB | Space | The string inserted in front of the opening curly bracket (OCB - opening curly bracket) |
suffixOCB | \ n | The string inserted after the opening brace |
prefixSCB | \ n | String inserted before closing curly bracket (CCB - closing curly bracket) |
suffixCCB | \ n | String inserted after a closing curly brace |
prefixAtRuleLine | 4 spaces | The line inserted before each line inside the @-rule |
suffixAtRuleLine | Empty line | The string to be inserted after each line inside the @-rule |
Source: https://habr.com/ru/post/256589/
All Articles