本文整理汇总了Python中blowdrycss.breakpointparser.BreakpointParser.css_for_down方法的典型用法代码示例。如果您正苦于以下问题:Python BreakpointParser.css_for_down方法的具体用法?Python BreakpointParser.css_for_down怎么用?Python BreakpointParser.css_for_down使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类blowdrycss.breakpointparser.BreakpointParser
的用法示例。
在下文中一共展示了BreakpointParser.css_for_down方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_css_for_down_wrong_limit_key
# 需要导入模块: from blowdrycss.breakpointparser import BreakpointParser [as 别名]
# 或者: from blowdrycss.breakpointparser.BreakpointParser import css_for_down [as 别名]
def test_css_for_down_wrong_limit_key(self):
css_class = 'padding-100-medium-down'
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 = '-only' # Change to WRONG LIMIT KEY.
css = breakpoint_parser.css_for_down()
self.assertEqual(css, expected)
示例2: test_css_for_down_general_usage
# 需要导入模块: from blowdrycss.breakpointparser import BreakpointParser [as 别名]
# 或者: from blowdrycss.breakpointparser.BreakpointParser import css_for_down [as 别名]
def test_css_for_down_general_usage(self):
css_class = 'padding-100-medium-down'
name = 'padding'
value = px_to_em('100')
expected = (
'@media only screen and (max-width: 45.0em) {\n' +
'\t.padding-100-medium-down {\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_down()
self.assertEqual(css, expected)
示例3: test_css_for_down_display_custom
# 需要导入模块: from blowdrycss.breakpointparser import BreakpointParser [as 别名]
# 或者: from blowdrycss.breakpointparser.BreakpointParser import css_for_down [as 别名]
def test_css_for_down_display_custom(self):
css_class = 'display-369-down'
name = 'display'
value = 'none'
expected = (
'@media only screen and (min-width: 23.0625em) {\n' +
'\t.display-369-down {\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_down()
self.assertEqual(css, expected)