当前位置: 首页>>代码示例>>Python>>正文


Python LY.css方法代码示例

本文整理汇总了Python中lightyear.LY.css方法的典型用法代码示例。如果您正苦于以下问题:Python LY.css方法的具体用法?Python LY.css怎么用?Python LY.css使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lightyear.LY的用法示例。


在下文中一共展示了LY.css方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_keyframe_e

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import css [as 别名]
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
开发者ID:divmain,项目名称:lightyear,代码行数:28,代码来源:test_lang.py

示例2: test_grid_nested_a

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import css [as 别名]
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
开发者ID:divmain,项目名称:lightyear,代码行数:30,代码来源:test_grid.py

示例3: test_keyframe_d

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import css [as 别名]
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
开发者ID:divmain,项目名称:lightyear,代码行数:36,代码来源:test_lang.py

示例4: test_type_sel

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import css [as 别名]
def test_type_sel():
    i = dedent('''
        body
            color: #000000
        ''')
    o = 'body{color:#000000;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_lang.py

示例5: test_pseudo_class_noparam

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import css [as 别名]
def test_pseudo_class_noparam():
    i = dedent('''
        a:hover
            color: white
        ''')
    o = 'a:hover{color:white;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_lang.py

示例6: test_hsl_darken

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import css [as 别名]
def test_hsl_darken():
    i = dedent(r'''
        p
            color: darken(hsl(190 30% 94%) 10%)
        ''')
    o = 'p{color:hsl(190,30%,84.6%);}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_functional_notation.py

示例7: test_universal_sel

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import css [as 别名]
def test_universal_sel():
    i = dedent('''
        *
            border: none
        ''')
    o = '*{border:none;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_lang.py

示例8: test_multiplication

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import css [as 别名]
def test_multiplication():
    i = dedent('''
        .button
            width: 4em * 8
        ''')
    o = '.button{width:32em;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_lang.py

示例9: test_division_float_a

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import css [as 别名]
def test_division_float_a():
    i = dedent('''
        #last
            height: 10px / 4
        ''')
    o = '#last{height:2.5px;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_lang.py

示例10: test_darken_b

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import css [as 别名]
def test_darken_b():
    i = dedent('''
        p
            color: darken(#ffffff #111111)
        ''')
    o = 'p{color:#eeeeee;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_builtin_functions.py

示例11: test_darken_d

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import css [as 别名]
def test_darken_d():
    i = dedent('''
        p
            color: darken(#ff1537 50)
        ''')
    o = 'p{color:#cd0005;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_builtin_functions.py

示例12: test_lighten_f

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import css [as 别名]
def test_lighten_f():
    i = dedent('''
        p
            color: lighten(black 16)
        ''')
    o = 'p{color:#101010;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_builtin_functions.py

示例13: test_lighten_g

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import css [as 别名]
def test_lighten_g():
    i = dedent('''
        p
            color: lighten(black #bdb76b)
        ''')
    o = 'p{color:darkkhaki;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_builtin_functions.py

示例14: test_lighten_e

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import css [as 别名]
def test_lighten_e():
    i = dedent('''
        p
            color: lighten(#96fa42 #69060c)
        ''')
    o = 'p{color:#ffff4e;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_builtin_functions.py

示例15: test_lighten_d

# 需要导入模块: from lightyear import LY [as 别名]
# 或者: from lightyear.LY import css [as 别名]
def test_lighten_d():
    i = dedent('''
        p
            color: lighten(#dc2c5c 50)
        ''')
    o = 'p{color:#ff5e8e;}'
    ly = LY()
    ly.eval(i)
    assert ly.css() == o
开发者ID:divmain,项目名称:lightyear,代码行数:11,代码来源:test_builtin_functions.py


注:本文中的lightyear.LY.css方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。