We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b34765d commit 2f38fa5Copy full SHA for 2f38fa5
tasks/converter/less_conversion.rb
@@ -173,6 +173,7 @@ def convert_to_scss(file)
173
file = replace_calculation_semantics(file)
174
file = replace_file_imports(file)
175
file = wrap_at_groups_with_at_root(file)
176
+ file = replace_division(file)
177
file
178
end
179
@@ -182,6 +183,12 @@ def wrap_at_groups_with_at_root(file)
182
183
}
184
185
186
+ def replace_division(less)
187
+ re = /(?<!\w)\(\s*([^(]+?)\s+\/\s+([^)]+?)\s*\)/
188
+ return less if less !~ re
189
+ "@use \"sass:math\";\n" + less.gsub(re, 'math.div(\1, \2)')
190
+ end
191
+
192
def sass_fn_exists(fn)
193
%Q{(#{fn}("") != unquote('#{fn}("")'))}
194
0 commit comments