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


Python BreakpointParser.css_for_only方法代码示例

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


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

示例1: test_css_for_only_wrong_limit_key

# 需要导入模块: from blowdrycss.breakpointparser import BreakpointParser [as 别名]
# 或者: from blowdrycss.breakpointparser.BreakpointParser import css_for_only [as 别名]
 def test_css_for_only_wrong_limit_key(self):
     css_class = 'padding-100-large-only'
     name = 'padding'
     value = px_to_em('100')
     expected = ''
     css_property = Property(name=name, value=value, priority='')
     breakpoint_parser = BreakpointParser(css_class=css_class, css_property=css_property)
     breakpoint_parser.limit_key = '-up'     # Change to WRONG LIMIT KEY
     css = breakpoint_parser.css_for_only()
     self.assertEqual(css, expected)
开发者ID:nueverest,项目名称:blowdrycss,代码行数:12,代码来源:test_BreakpointParser.py

示例2: test_css_for_only_general_usage

# 需要导入模块: from blowdrycss.breakpointparser import BreakpointParser [as 别名]
# 或者: from blowdrycss.breakpointparser.BreakpointParser import css_for_only [as 别名]
 def test_css_for_only_general_usage(self):
     css_class = 'padding-100-large-only'
     name = 'padding'
     value = px_to_em('100')
     expected = (
         '@media only screen and (min-width: 45.0625em) and (max-width: 64.0em) {\n' +
         '\t.padding-100-large-only {\n' +
         '\t\tpadding: 6.25em;\n' +
         '\t}\n' +
         '}\n\n'
     )
     css_property = Property(name=name, value=value, priority='')
     breakpoint_parser = BreakpointParser(css_class=css_class, css_property=css_property)
     css = breakpoint_parser.css_for_only()
     self.assertEqual(css, expected)
开发者ID:nueverest,项目名称:blowdrycss,代码行数:17,代码来源:test_BreakpointParser.py

示例3: test_css_for_only_display_shorthand

# 需要导入模块: from blowdrycss.breakpointparser import BreakpointParser [as 别名]
# 或者: from blowdrycss.breakpointparser.BreakpointParser import css_for_only [as 别名]
 def test_css_for_only_display_shorthand(self):
     css_class = 'large-only'
     name = 'display'
     value = 'none'
     expected = (
         '@media only screen and (max-width: 45.0625em) {\n' +
         '\t.large-only {\n' +
         '\t\tdisplay: none;\n' +
         '\t}\n' +
         '}\n\n' +
         '@media only screen and (min-width: 64.0em) {\n' +
         '\t.large-only {\n' +
         '\t\tdisplay: none;\n' +
         '\t}\n' +
         '}\n\n'
     )
     css_property = Property(name=name, value=value, priority='')
     breakpoint_parser = BreakpointParser(css_class=css_class, css_property=css_property)
     css = breakpoint_parser.css_for_only()
     self.assertEqual(css, expected)
开发者ID:nueverest,项目名称:blowdrycss,代码行数:22,代码来源:test_BreakpointParser.py


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