本文整理汇总了Python中scss.Scss._scss_files方法的典型用法代码示例。如果您正苦于以下问题:Python Scss._scss_files方法的具体用法?Python Scss._scss_files怎么用?Python Scss._scss_files使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scss.Scss
的用法示例。
在下文中一共展示了Scss._scss_files方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_extend_across_files
# 需要导入模块: from scss import Scss [as 别名]
# 或者: from scss.Scss import _scss_files [as 别名]
def test_extend_across_files():
compiler = Scss(scss_opts=dict(compress=0))
compiler._scss_files = OrderedDict()
compiler._scss_files['first.css'] = '''
@option style:legacy, short_colors:yes, reverse_colors:yes;
.specialClass extends .basicClass {
padding: 10px;
font-size: 14px;
}
'''
compiler._scss_files['second.css'] = '''
@option style:legacy, short_colors:yes, reverse_colors:yes;
.basicClass {
padding: 20px;
background-color: #FF0000;
}
'''
actual = compiler.compile()
expected = """\
.specialClass {
padding: 10px;
font-size: 14px;
}
.basicClass, .specialClass {
padding: 20px;
background-color: #FF0000;
}
"""
assert expected == actual
示例2: test_debug_info
# 需要导入模块: from scss import Scss [as 别名]
# 或者: from scss.Scss import _scss_files [as 别名]
def test_debug_info():
# nb: debug info doesn't work if the source isn't a file
compiler = Scss(scss_opts=dict(style='expanded', debug_info=True))
compiler._scss_files = {}
compiler._scss_files['input.css'] = """\
div {
color: green;
}
table {
color: red;
}
"""
expected = """\
@media -sass-debug-info{filename{font-family:file\:\/\/input\.css}line{font-family:\\000031}}
div {
color: green;
}
@media -sass-debug-info{filename{font-family:file\:\/\/input\.css}line{font-family:\\000034}}
table {
color: red;
}
"""
output = compiler.compile()
assert expected == output