jasy.style.parse package¶
Submodules¶
jasy.style.parse.Node module¶
-
class
jasy.style.parse.Node.
Node
(tokenizer=None, type=None, args=[])[source]¶ Bases:
jasy.parse.AbstractNode.AbstractNode
-
assignOp
¶
-
comments
¶
-
condition
¶
-
dynamic
¶
-
elsePart
¶
-
end
¶
-
fileId
¶
-
initializer
¶
-
line
¶
-
name
¶
-
names
¶
-
noscope
¶
-
params
¶
-
parent
¶
-
parenthesized
¶
-
quote
¶
-
rel
¶
-
rules
¶
-
scope
¶
-
selector
¶
-
start
¶
-
statement
¶
-
statements
¶
-
thenPart
¶
-
token
¶
-
tokenizer
¶
-
type
¶
-
unit
¶
-
value
¶
-
variables
¶
-
vendor
¶
-
jasy.style.parse.Parser module¶
-
jasy.style.parse.Parser.
Expression
(tokenizer, staticContext)[source]¶ Top-down expression parser for stylestyles.
-
jasy.style.parse.Parser.
KeyFrames
(tokenizer, staticContext)[source]¶ Supports e.g.:
- @keyframes fade{
- from, 10%{
- background-color: #000000;
}
- 100%{
- background-color: #FFFFFF;
}
}
-
jasy.style.parse.Parser.
Media
(tokenizer, staticContext)[source]¶ Supports e.g.:
- @media print{
- body{
- background-color: #000000;
}
}
- @media handheld, tv{
- body{
- background-color: yellow;
}
}
- @media screen and (max-width: 300px) {
- body{
- background-color: orange;
}
}
-
jasy.style.parse.Parser.
Page
(tokenizer, staticContext)[source]¶ Supports e.g.:
- @page{
- margin: 1cm;
}
- @page :first{
- margin: 5cm 2cm;
}
-
jasy.style.parse.Parser.
ParenExpression
(tokenizer, staticContext)[source]¶ An expression in parens.
Sometimes to force priority of math operations etc.
-
jasy.style.parse.Parser.
Property
(tokenizer, staticContext)[source]¶ Parses all CSS properties e.g.
- background: red
- font: 12px bold Arial;
-
jasy.style.parse.Parser.
Root
(tokenizer, staticContext)[source]¶ Supports e.g.:
- h1{
font-size: 20px;
- @root html.desktop &{
- font-size: 30px;
}
}
- .date{
color: black; background: white;
- @root{
- &__dialog{
- position: absolute;
}
}
}
-
jasy.style.parse.Parser.
Selector
(tokenizer, staticContext)[source]¶ CSS selector parser e.g.
h1 .infobox #header h1::after h2:first-child
-
jasy.style.parse.Parser.
Sheet
(tokenizer, staticContext)[source]¶ Parses the toplevel and rule bodies.
-
jasy.style.parse.Parser.
ValueExpression
(tokenizer, staticContext)[source]¶ Top-down expression parser for rule values in stylestyles.
jasy.style.parse.ScopeScanner module¶
-
jasy.style.parse.ScopeScanner.
scan
(tree)[source]¶ Scans the given tree and attaches variable data instances (core/ScopeData.py) to every scope (aka function).
This data is being stored independently from the real tree so that if you modifiy the tree the data is not automatically updated. This means that every time you modify the tree heavily, it might make sense to re-execute this method to bring it in sync to the current tree structure.