PHP Class titanscssc

Author: Leaf Corcoran ([email protected])
Afficher le fichier Open project: gambitph/titan-framework Class Usage Examples

Méthodes publiques

Свойство Type Description
$VERSION
$defaultValue
$false
$null
$selfSelector
$true

Protected Properties

Свойство Type Description
$cssColors CSS Colors
$formatter
$importCache
$importPaths
$lib_abs
$lib_adjust_color
$lib_adjust_hue
$lib_alpha
$lib_append
$lib_blue
$lib_ceil
$lib_change_color
$lib_comparable
$lib_complement
$lib_darken
$lib_desaturate
$lib_fade_in
$lib_fade_out
$lib_floor
$lib_grayscale
$lib_green
$lib_hsl
$lib_hsla
$lib_hue
$lib_ie_hex_str
$lib_if Built in functions
$lib_index
$lib_invert
$lib_join
$lib_length
$lib_lighten
$lib_lightness
$lib_mix mix two colors
$lib_nth
$lib_opacify increases opacity by amount
$lib_opacity
$lib_percentage
$lib_quote
$lib_red
$lib_rgb
$lib_rgba
$lib_round
$lib_saturate
$lib_saturation
$lib_scale_color
$lib_transparentize decreases opacity by amount
$lib_type_of
$lib_unit
$lib_unitless
$lib_unquote
$namespaces
$numberPrecision
$operatorNames
$unitTable
$userFunctions

Méthodes publiques

Méthode Description
addImportPath ( $path )
assertColor ( $value )
assertList ( $value )
assertNumber ( $value )
compile ( $code, $name = null )
findImport ( $url ) results the file path for an import url if it exists
get ( $name, $defaultValue = null, $env = null )
getParsedFiles ( )
hueToRGB ( $m1, $m2, $h )
normalizeValue ( $value )
registerFunction ( $name, $func )
setFormatter ( $formatterName )
setImportPaths ( $path )
setNumberPrecision ( $numberPrecision )
throwError ( $msg = null )
toBool ( $thing )
toHSL ( $red, $green, $blue )
toRGB ( $hue, $saturation, $lightness ) H from 0 to 360, S and L from 0 to 100
unregisterFunction ( $name )

Méthodes protégées

Méthode Description
adjustHsl ( $color, $idx, $amount )
adjust_color_helper ( $base, $alter, $i )
alter_color ( $args, $fn ) helper function for adjust_color, change_color, and scale_color
applyArguments ( $argDef, $argValues )
callBuiltin ( $name, $args, &$returnValue )
change_color_helper ( $base, $alter, $i )
coerceColor ( $value )
coerceForExpression ( $value )
coerceList ( $item, $delim = "," ) convert something to list
coercePercent ( $value )
coerceString ( $value )
coerceUnit ( $number, $unit ) $number should be normalized
combineSelectorSingle ( $base, $other )
compileBlock ( StdClass $block ) Recursively compiles a block.
compileChild ( $child, $out ) return a value to halt execution
compileChildren ( $stms, $out )
compileImport ( $rawPath, $out ) returns true if the value was something that could be imported
compileMedia ( $media )
compileMediaQuery ( $queryList )
compileNestedBlock ( $block, $selectors ) TODO refactor compileNestedBlock and compileMedia into same thing
compileRoot ( $rootBlock )
compileSelector ( $selector ) self(&) should have been replaced by now
compileSelectorPart ( $piece )
compileStringContent ( $string )
compileValue ( array $value ) Compiles a primitive value into a CSS property value.
evalSelector ( $selector ) replaces all the interpolates
evalSelectorPart ( $piece )
expToString ( $exp )
extractInterpolation ( $list ) doesn't need to be recursive, compileValue will handle that
fileExists ( $name )
fixColor ( $c ) make sure a color's components don't go out of bounds
flattenSelectorSingle ( $single ) joins together .classes and #ids
flattenSelectors ( $block, $parentKey = null )
getNormalizedNumbers ( $args )
getStoreEnv ( )
hasSelectorPlaceholder ( $selector )
importFile ( $path, $out )
isSelfExtend ( $target, $origin )
isTruthy ( $value )
joinSelectors ( $parent, $child ) looks for & to replace, or append parent before child
lib_abs ( $args )
lib_adjust_color ( $args )
lib_adjust_hue ( $args )
lib_alpha ( $args )
lib_append ( $args )
lib_blue ( $args )
lib_ceil ( $args )
lib_change_color ( $args )
lib_comparable ( $args )
lib_complement ( $args )
lib_counter ( array $args ) Workaround IE7's content counter bug.
lib_darken ( $args )
lib_desaturate ( $args )
lib_fade_in ( $args )
lib_fade_out ( $args )
lib_floor ( $args )
lib_grayscale ( $args )
lib_green ( $args )
lib_hsl ( $args )
lib_hsla ( $args )
lib_hue ( $args )
lib_ie_hex_str ( $args )
lib_if ( $args )
lib_index ( $args )
lib_invert ( $args )
lib_join ( $args )
lib_length ( $args )
lib_lighten ( $args )
lib_lightness ( $args )
lib_max ( $args )
lib_min ( $args )
lib_mix ( $args )
lib_nth ( $args )
lib_opacify ( $args )
lib_opacity ( $args )
lib_percentage ( $args )
lib_quote ( $args )
lib_red ( $args )
lib_rgb ( $args )
lib_rgba ( $args )
lib_round ( $args )
lib_saturate ( $args )
lib_saturation ( $args )
lib_scale_color ( $args )
lib_transparentize ( $args )
lib_type_of ( $args )
lib_unit ( $args )
lib_unitless ( $args )
lib_unquote ( $args )
lib_zip ( $args )
listSeparatorForJoin ( $list1, $sep )
makeOutputBlock ( $type, $selectors = null )
matchExtends ( $selector, &$out, $from, $initial = true )
matchExtendsSingle ( $single, &$outOrigin )
mediaParent ( $scope )
multiplyMedia ( $env, $childQueries = null )
multiplySelectors ( $env ) find the final set of selectors
normalizeName ( $name )
normalizeNumber ( $number ) just does physical lengths for now
op_add ( $left, $right ) adding strings
op_add_number_number ( $left, $right )
op_and ( $left, $right, $shouldEval )
op_color_color ( $op, $left, $right )
op_color_number ( $op, $left, $right )
op_div_number_number ( $left, $right )
op_eq ( $left, $right )
op_gt_number_number ( $left, $right )
op_gte_number_number ( $left, $right )
op_lt_number_number ( $left, $right )
op_lte_number_number ( $left, $right )
op_mod_number_number ( $left, $right )
op_mul_number_number ( $left, $right )
op_neq ( $left, $right )
op_number_color ( $op, $left, $right )
op_or ( $left, $right, $shouldEval )
op_sub_number_number ( $left, $right )
popEnv ( )
pushEnv ( $block = null )
pushExtends ( $target, $origin )
reduce ( $value, $inExp = false )
scale_color_helper ( $base, $scale, $i )
set ( $name, $value, $shadow = false )
setExisting ( $name, $value, $env = null )
setRaw ( $name, $value )
shouldEval ( $value ) should $value cause its operand to eval
sortArgs ( $prototype, $args ) TODO: merge with apply arguments

Method Details

addImportPath() public méthode

public addImportPath ( $path )

adjustHsl() protected méthode

protected adjustHsl ( $color, $idx, $amount )

adjust_color_helper() protected méthode

protected adjust_color_helper ( $base, $alter, $i )

alter_color() protected méthode

helper function for adjust_color, change_color, and scale_color
protected alter_color ( $args, $fn )

applyArguments() protected méthode

protected applyArguments ( $argDef, $argValues )

assertColor() public méthode

public assertColor ( $value )

assertList() public méthode

public assertList ( $value )

assertNumber() public méthode

public assertNumber ( $value )

callBuiltin() protected méthode

protected callBuiltin ( $name, $args, &$returnValue )

change_color_helper() protected méthode

protected change_color_helper ( $base, $alter, $i )

coerceColor() protected méthode

protected coerceColor ( $value )

coerceForExpression() protected méthode

protected coerceForExpression ( $value )

coerceList() protected méthode

convert something to list
protected coerceList ( $item, $delim = "," )

coercePercent() protected méthode

protected coercePercent ( $value )

coerceString() protected méthode

protected coerceString ( $value )

coerceUnit() protected méthode

$number should be normalized
protected coerceUnit ( $number, $unit )

combineSelectorSingle() protected méthode

protected combineSelectorSingle ( $base, $other )

compile() public méthode

public compile ( $code, $name = null )

compileBlock() protected méthode

A block is analogous to a CSS block in most cases. A single SCSS document is encapsulated in a block when parsed, but it does not have parent tags so all of its children appear on the root level when compiled. Blocks are made up of selectors and children. The children of a block are just all the blocks that are defined within. Compiling the block involves pushing a fresh environment on the stack, and iterating through the props, compiling each one.
See also: scss::compileChild()
protected compileBlock ( StdClass $block )
$block StdClass

compileChild() protected méthode

return a value to halt execution
protected compileChild ( $child, $out )

compileChildren() protected méthode

protected compileChildren ( $stms, $out )

compileImport() protected méthode

returns true if the value was something that could be imported
protected compileImport ( $rawPath, $out )

compileMedia() protected méthode

protected compileMedia ( $media )

compileMediaQuery() protected méthode

protected compileMediaQuery ( $queryList )

compileNestedBlock() protected méthode

TODO refactor compileNestedBlock and compileMedia into same thing
protected compileNestedBlock ( $block, $selectors )

compileRoot() protected méthode

protected compileRoot ( $rootBlock )

compileSelector() protected méthode

self(&) should have been replaced by now
protected compileSelector ( $selector )

compileSelectorPart() protected méthode

protected compileSelectorPart ( $piece )

compileStringContent() protected méthode

protected compileStringContent ( $string )

compileValue() protected méthode

Values in scssphp are typed by being wrapped in arrays, their format is typically: array(type, contents [, additional_contents]*) The input is expected to be reduced. This function will not work on things like expressions and variables.
protected compileValue ( array $value )
$value array

evalSelector() protected méthode

replaces all the interpolates
protected evalSelector ( $selector )

evalSelectorPart() protected méthode

protected evalSelectorPart ( $piece )

expToString() protected méthode

protected expToString ( $exp )

extractInterpolation() protected méthode

doesn't need to be recursive, compileValue will handle that
protected extractInterpolation ( $list )

fileExists() protected méthode

protected fileExists ( $name )

findImport() public méthode

results the file path for an import url if it exists
public findImport ( $url )

fixColor() protected méthode

make sure a color's components don't go out of bounds
protected fixColor ( $c )

flattenSelectorSingle() protected méthode

joins together .classes and #ids
protected flattenSelectorSingle ( $single )

flattenSelectors() protected méthode

protected flattenSelectors ( $block, $parentKey = null )

get() public méthode

public get ( $name, $defaultValue = null, $env = null )

getNormalizedNumbers() protected méthode

protected getNormalizedNumbers ( $args )

getParsedFiles() public méthode

public getParsedFiles ( )

getStoreEnv() protected méthode

protected getStoreEnv ( )

hasSelectorPlaceholder() protected méthode

protected hasSelectorPlaceholder ( $selector )

hueToRGB() public méthode

public hueToRGB ( $m1, $m2, $h )

importFile() protected méthode

protected importFile ( $path, $out )

isSelfExtend() protected méthode

protected isSelfExtend ( $target, $origin )

isTruthy() protected méthode

protected isTruthy ( $value )

joinSelectors() protected méthode

looks for & to replace, or append parent before child
protected joinSelectors ( $parent, $child )

lib_abs() protected méthode

protected lib_abs ( $args )

lib_adjust_color() protected méthode

protected lib_adjust_color ( $args )

lib_adjust_hue() protected méthode

protected lib_adjust_hue ( $args )

lib_alpha() protected méthode

protected lib_alpha ( $args )

lib_append() protected méthode

protected lib_append ( $args )

lib_blue() protected méthode

protected lib_blue ( $args )

lib_ceil() protected méthode

protected lib_ceil ( $args )

lib_change_color() protected méthode

protected lib_change_color ( $args )

lib_comparable() protected méthode

protected lib_comparable ( $args )

lib_complement() protected méthode

protected lib_complement ( $args )

lib_counter() protected méthode

Workaround IE7's content counter bug.
protected lib_counter ( array $args )
$args array

lib_darken() protected méthode

protected lib_darken ( $args )

lib_desaturate() protected méthode

protected lib_desaturate ( $args )

lib_fade_in() protected méthode

protected lib_fade_in ( $args )

lib_fade_out() protected méthode

protected lib_fade_out ( $args )

lib_floor() protected méthode

protected lib_floor ( $args )

lib_grayscale() protected méthode

protected lib_grayscale ( $args )

lib_green() protected méthode

protected lib_green ( $args )

lib_hsl() protected méthode

protected lib_hsl ( $args )

lib_hsla() protected méthode

protected lib_hsla ( $args )

lib_hue() protected méthode

protected lib_hue ( $args )

lib_ie_hex_str() protected méthode

protected lib_ie_hex_str ( $args )

lib_if() protected méthode

protected lib_if ( $args )

lib_index() protected méthode

protected lib_index ( $args )

lib_invert() protected méthode

protected lib_invert ( $args )

lib_join() protected méthode

protected lib_join ( $args )

lib_length() protected méthode

protected lib_length ( $args )

lib_lighten() protected méthode

protected lib_lighten ( $args )

lib_lightness() protected méthode

protected lib_lightness ( $args )

lib_max() protected méthode

protected lib_max ( $args )

lib_min() protected méthode

protected lib_min ( $args )

lib_mix() protected méthode

protected lib_mix ( $args )

lib_nth() protected méthode

protected lib_nth ( $args )

lib_opacify() protected méthode

protected lib_opacify ( $args )

lib_opacity() protected méthode

protected lib_opacity ( $args )

lib_percentage() protected méthode

protected lib_percentage ( $args )

lib_quote() protected méthode

protected lib_quote ( $args )

lib_red() protected méthode

protected lib_red ( $args )

lib_rgb() protected méthode

protected lib_rgb ( $args )

lib_rgba() protected méthode

protected lib_rgba ( $args )

lib_round() protected méthode

protected lib_round ( $args )

lib_saturate() protected méthode

protected lib_saturate ( $args )

lib_saturation() protected méthode

protected lib_saturation ( $args )

lib_scale_color() protected méthode

protected lib_scale_color ( $args )

lib_transparentize() protected méthode

protected lib_transparentize ( $args )

lib_type_of() protected méthode

protected lib_type_of ( $args )

lib_unit() protected méthode

protected lib_unit ( $args )

lib_unitless() protected méthode

protected lib_unitless ( $args )

lib_unquote() protected méthode

protected lib_unquote ( $args )

lib_zip() protected méthode

protected lib_zip ( $args )

listSeparatorForJoin() protected méthode

protected listSeparatorForJoin ( $list1, $sep )

makeOutputBlock() protected méthode

protected makeOutputBlock ( $type, $selectors = null )

matchExtends() protected méthode

protected matchExtends ( $selector, &$out, $from, $initial = true )

matchExtendsSingle() protected méthode

protected matchExtendsSingle ( $single, &$outOrigin )

mediaParent() protected méthode

protected mediaParent ( $scope )

multiplyMedia() protected méthode

protected multiplyMedia ( $env, $childQueries = null )

multiplySelectors() protected méthode

find the final set of selectors
protected multiplySelectors ( $env )

normalizeName() protected méthode

protected normalizeName ( $name )

normalizeNumber() protected méthode

just does physical lengths for now
protected normalizeNumber ( $number )

normalizeValue() public méthode

public normalizeValue ( $value )

op_add() protected méthode

adding strings
protected op_add ( $left, $right )

op_add_number_number() protected méthode

protected op_add_number_number ( $left, $right )

op_and() protected méthode

protected op_and ( $left, $right, $shouldEval )

op_color_color() protected méthode

protected op_color_color ( $op, $left, $right )

op_color_number() protected méthode

protected op_color_number ( $op, $left, $right )

op_div_number_number() protected méthode

protected op_div_number_number ( $left, $right )

op_eq() protected méthode

protected op_eq ( $left, $right )

op_gt_number_number() protected méthode

protected op_gt_number_number ( $left, $right )

op_gte_number_number() protected méthode

protected op_gte_number_number ( $left, $right )

op_lt_number_number() protected méthode

protected op_lt_number_number ( $left, $right )

op_lte_number_number() protected méthode

protected op_lte_number_number ( $left, $right )

op_mod_number_number() protected méthode

protected op_mod_number_number ( $left, $right )

op_mul_number_number() protected méthode

protected op_mul_number_number ( $left, $right )

op_neq() protected méthode

protected op_neq ( $left, $right )

op_number_color() protected méthode

protected op_number_color ( $op, $left, $right )

op_or() protected méthode

protected op_or ( $left, $right, $shouldEval )

op_sub_number_number() protected méthode

protected op_sub_number_number ( $left, $right )

popEnv() protected méthode

protected popEnv ( )

pushEnv() protected méthode

protected pushEnv ( $block = null )

pushExtends() protected méthode

protected pushExtends ( $target, $origin )

reduce() protected méthode

protected reduce ( $value, $inExp = false )

registerFunction() public méthode

public registerFunction ( $name, $func )

scale_color_helper() protected méthode

protected scale_color_helper ( $base, $scale, $i )

set() protected méthode

protected set ( $name, $value, $shadow = false )

setExisting() protected méthode

protected setExisting ( $name, $value, $env = null )

setFormatter() public méthode

public setFormatter ( $formatterName )

setImportPaths() public méthode

public setImportPaths ( $path )

setNumberPrecision() public méthode

public setNumberPrecision ( $numberPrecision )

setRaw() protected méthode

protected setRaw ( $name, $value )

shouldEval() protected méthode

should $value cause its operand to eval
protected shouldEval ( $value )

sortArgs() protected méthode

TODO: merge with apply arguments
protected sortArgs ( $prototype, $args )

throwError() public méthode

public throwError ( $msg = null )

toBool() public méthode

public toBool ( $thing )

toHSL() public méthode

public toHSL ( $red, $green, $blue )

toRGB() public méthode

H from 0 to 360, S and L from 0 to 100
public toRGB ( $hue, $saturation, $lightness )

unregisterFunction() public méthode

public unregisterFunction ( $name )

Property Details

$VERSION public_oe static_oe property

public static $VERSION

$cssColors protected_oe static_oe property

CSS Colors
See also: http://www.w3.org/TR/css3-color
protected static $cssColors

$defaultValue public_oe static_oe property

public static $defaultValue

$false public_oe static_oe property

public static $false

$formatter protected_oe property

protected $formatter

$importCache protected_oe property

protected $importCache

$importPaths protected_oe property

protected $importPaths

$lib_abs protected_oe static_oe property

protected static $lib_abs

$lib_adjust_color protected_oe static_oe property

protected static $lib_adjust_color

$lib_adjust_hue protected_oe static_oe property

protected static $lib_adjust_hue

$lib_alpha protected_oe static_oe property

protected static $lib_alpha

$lib_append protected_oe static_oe property

protected static $lib_append

$lib_blue protected_oe static_oe property

protected static $lib_blue

$lib_ceil protected_oe static_oe property

protected static $lib_ceil

$lib_change_color protected_oe static_oe property

protected static $lib_change_color

$lib_comparable protected_oe static_oe property

protected static $lib_comparable

$lib_complement protected_oe static_oe property

protected static $lib_complement

$lib_darken protected_oe static_oe property

protected static $lib_darken

$lib_desaturate protected_oe static_oe property

protected static $lib_desaturate

$lib_fade_in protected_oe static_oe property

protected static $lib_fade_in

$lib_fade_out protected_oe static_oe property

protected static $lib_fade_out

$lib_floor protected_oe static_oe property

protected static $lib_floor

$lib_grayscale protected_oe static_oe property

protected static $lib_grayscale

$lib_green protected_oe static_oe property

protected static $lib_green

$lib_hsl protected_oe static_oe property

protected static $lib_hsl

$lib_hsla protected_oe static_oe property

protected static $lib_hsla

$lib_hue protected_oe static_oe property

protected static $lib_hue

$lib_ie_hex_str protected_oe static_oe property

protected static $lib_ie_hex_str

$lib_if protected_oe static_oe property

Built in functions
protected static $lib_if

$lib_index protected_oe static_oe property

protected static $lib_index

$lib_invert protected_oe static_oe property

protected static $lib_invert

$lib_join protected_oe static_oe property

protected static $lib_join

$lib_length protected_oe static_oe property

protected static $lib_length

$lib_lighten protected_oe static_oe property

protected static $lib_lighten

$lib_lightness protected_oe static_oe property

protected static $lib_lightness

$lib_mix protected_oe static_oe property

mix two colors
protected static $lib_mix

$lib_nth protected_oe static_oe property

protected static $lib_nth

$lib_opacify protected_oe static_oe property

increases opacity by amount
protected static $lib_opacify

$lib_opacity protected_oe static_oe property

protected static $lib_opacity

$lib_percentage protected_oe static_oe property

protected static $lib_percentage

$lib_quote protected_oe static_oe property

protected static $lib_quote

$lib_red protected_oe static_oe property

protected static $lib_red

$lib_rgb protected_oe static_oe property

protected static $lib_rgb

$lib_rgba protected_oe static_oe property

protected static $lib_rgba

$lib_round protected_oe static_oe property

protected static $lib_round

$lib_saturate protected_oe static_oe property

protected static $lib_saturate

$lib_saturation protected_oe static_oe property

protected static $lib_saturation

$lib_scale_color protected_oe static_oe property

protected static $lib_scale_color

$lib_transparentize protected_oe static_oe property

decreases opacity by amount
protected static $lib_transparentize

$lib_type_of protected_oe static_oe property

protected static $lib_type_of

$lib_unit protected_oe static_oe property

protected static $lib_unit

$lib_unitless protected_oe static_oe property

protected static $lib_unitless

$lib_unquote protected_oe static_oe property

protected static $lib_unquote

$namespaces protected_oe static_oe property

protected static $namespaces

$null public_oe static_oe property

public static $null

$numberPrecision protected_oe property

protected $numberPrecision

$operatorNames protected_oe static_oe property

protected static $operatorNames

$selfSelector public_oe static_oe property

public static $selfSelector

$true public_oe static_oe property

public static $true

$unitTable protected_oe static_oe property

protected static $unitTable

$userFunctions protected_oe property

protected $userFunctions