tasks/converter/less_conversion.rb in bootstrap-sass-3.3.4.1 vs tasks/converter/less_conversion.rb in bootstrap-sass-3.3.5
- old
+ new
@@ -116,14 +116,14 @@
end
when 'navbar.less'
file = replace_all file, /(\s*)\.navbar-(right|left)\s*\{\s*@extend\s*\.pull-(right|left);\s*/, "\\1.navbar-\\2 {\\1 float: \\2 !important;\\1"
when 'tables.less'
file = replace_all file, /(@include\s*table-row-variant\()(\w+)/, "\\1'\\2'"
- when 'thumbnails.less', 'labels.less', 'badges.less'
+ when 'thumbnails.less', 'labels.less', 'badges.less', 'buttons.less'
file = extract_nested_rule file, 'a&'
when 'glyphicons.less'
- file = replace_rules(file, '@font-face') { |rule|
+ file = replace_rules(file, /\s*@font-face/) { |rule|
rule = replace_all rule, /(\$icon-font(?:-\w+)+)/, '#{\1}'
replace_asset_url rule, :font
}
when 'type.less'
file = apply_mixin_parent_selector(file, '\.(text|bg)-(success|primary|info|warning|danger)')
@@ -167,10 +167,17 @@
file = replace_escaping(file)
file = convert_less_ampersand(file)
file = deinterpolate_vararg_mixins(file)
file = replace_calculation_semantics(file)
file = replace_file_imports(file)
+ file = wrap_at_groups_with_at_root(file)
file
+ end
+
+ def wrap_at_groups_with_at_root(file)
+ replace_rules(file, /@(?:font-face|-ms-viewport)/) { |rule, _pos|
+ %Q(@at-root {\n#{indent rule, 2}\n})
+ }
end
def sass_fn_exists(fn)
%Q{(#{fn}("") != unquote('#{fn}("")'))}
end