本文整理汇总了Python中lightyear.LY类的典型用法代码示例。如果您正苦于以下问题:Python LY类的具体用法?Python LY怎么用?Python LY使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LY类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_keyframe_d
def test_keyframe_d():
i = dedent('''
div
width: 100px
height: 100px
background: red
position: relative
animation: warpmove 5s infinite
@keyframes warpmove
(a) 0%
top: 0px
background: red
width: 100px
(b) 0%
top: 170px
background: blue
width: 50px
(a) 100%
top: 200px
background: yellow
width: 300px
(b) 100%
top: 300px
background: yellow
width: 500px
(root)
(root.b)
''')
o = ('div{width:100px;height:100px;background:red;position:relative;animation:warpmove 5s infinite;}'
'@keyframes warpmove{0%{top:170px;background:blue;width:50px;}'
'100%{top:300px;background:yellow;width:500px;}}')
ly = LY()
ly.eval(i)
assert ly.css() == o
示例2: test_keyframe_e
def test_keyframe_e():
i = dedent('''
start = 0%
end = 100%
div
width: 100px
height: 100px
background: red
position: relative
animation: warpmove 5s infinite
@keyframes warpmove
start
top: 0px
background: red
width: 100px
end
top: 200px
background: yellow
width: 300px
''')
o = ('div{width:100px;height:100px;background:red;position:relative;animation:warpmove 5s infinite;}'
'@keyframes warpmove{0%{top:0px;background:red;width:100px;}'
'100%{top:200px;background:yellow;width:300px;}}')
ly = LY()
ly.eval(i)
assert ly.css() == o
示例3: test_grid_nested_a
def test_grid_nested_a():
i = dedent('''
// Configure primary grid with 16 columns.
grid-columns = 16
grid-column-width = 60px
grid-gutter = 32px
// Configure nested grid
// - consumes 8 columns of parent grid.
// - configures 3 inner columns
// - configures gutter of 64px for inner columns
ngrid-1-parent = 0
ngrid-1-ocolumns = 8
ngrid-1-icolumns = 4
ngrid-1-gutter = 64px
.outside
col(8)
.inside
ncol(1 1)
''')
o = ('.outside{box-sizing:border-box;display:inline-block;width:480px;margin-left:16px;margin-right:16px;}'
'.inside{box-sizing:border-box;display:inline-block;width:112px;margin-left:32px;margin-right:32px;}')
ly = LY()
ly.eval(i)
assert ly.css() == o
示例4: test_example_vendorize
def test_example_vendorize():
with open(os.path.join(TEST_DIR, 'divmain.ly'), 'r') as f:
i = f.read()
with open(os.path.join(TEST_DIR, 'divmain.vendor.css'), 'r') as f:
o = f.read()
ly = LY(vendorize='offline')
ly.eval(i)
assert ly.pretty_css() == o
示例5: test_example_file
def test_example_file():
with open(os.path.join(TEST_DIR, 'divmain.ly'), 'r') as f:
i = f.read()
with open(os.path.join(TEST_DIR, 'divmain.css'), 'r') as f:
o = f.read()
ly = LY()
ly.eval(i)
assert ly.pretty_css() == o
示例6: test_division_int
def test_division_int():
i = dedent('''
div#first.button
width: 20px / 4
''')
o = 'div#first.button{width:5px;}'
ly = LY()
ly.eval(i)
assert ly.css() == o
示例7: test_multiplication
def test_multiplication():
i = dedent('''
.button
width: 4em * 8
''')
o = '.button{width:32em;}'
ly = LY()
ly.eval(i)
assert ly.css() == o
示例8: test_lighten_g
def test_lighten_g():
i = dedent('''
p
color: lighten(black #bdb76b)
''')
o = 'p{color:darkkhaki;}'
ly = LY()
ly.eval(i)
assert ly.css() == o
示例9: test_id_type_sel
def test_id_type_sel():
i = dedent('''
a#first
display: block
''')
o = 'a#first{display:block;}'
ly = LY()
ly.eval(i)
assert ly.css() == o
示例10: test_universal_sel
def test_universal_sel():
i = dedent('''
*
border: none
''')
o = '*{border:none;}'
ly = LY()
ly.eval(i)
assert ly.css() == o
示例11: test_lighten_e
def test_lighten_e():
i = dedent('''
p
color: lighten(#96fa42 #69060c)
''')
o = 'p{color:#ffff4e;}'
ly = LY()
ly.eval(i)
assert ly.css() == o
示例12: test_lighten_a
def test_lighten_a():
i = dedent('''
p
color: lighten(#202020 10%)
''')
o = 'p{color:#232323;}'
ly = LY()
ly.eval(i)
assert ly.css() == o
示例13: test_lighten_b
def test_lighten_b():
i = dedent('''
p
color: lighten(#404040 #101010)
''')
o = 'p{color:#505050;}'
ly = LY()
ly.eval(i)
assert ly.css() == o
示例14: test_darken_g
def test_darken_g():
i = dedent('''
p
color: darken(white #ff9bff)
''')
o = 'p{color:darkgreen;}'
ly = LY()
ly.eval(i)
assert ly.css() == o
示例15: test_darken_a
def test_darken_a():
i = dedent('''
p
color: darken(#ffffff 10%)
''')
o = 'p{color:#e5e5e5;}'
ly = LY()
ly.eval(i)
assert ly.css() == o