1
0
Fork 0
mirror of https://github.com/twbs/bootstrap-sass.git synced 2022-11-09 12:27:02 -05:00

More mixin pattern improvements

This commit is contained in:
Peter Gumeson 2013-05-28 23:39:29 -07:00
parent e9da9de5b5
commit 53e1e3ea52

View file

@ -145,7 +145,7 @@ private
# .mixin() -> @import twbs-mixin()
# #scope > .mixin() -> @import twbs-scope-mixin()
def replace_mixins(less)
mixin_pattern = /(\s*)(([#|\.][\w-]+\s*>\s*)*)\.([\w-]+\(.*\))\s*{?/
mixin_pattern = /(\s*)(([#|\.][\w-]+\s*>\s*)*)\.([\w-]+\(.*\))/
less.gsub(mixin_pattern) do |match|
matches = match.scan(mixin_pattern).flatten
scope = matches[1] || ''
@ -159,7 +159,7 @@ private
end
def replace_mixin_file(less)
less.gsub(/^\.([\w-]+\(.*\)\s?{?)$/, '@mixin twbs-\1')
less.gsub(/^(\s*)\.([\w-]+\(.*\))(\s*{)/, '\1@mixin twbs-\2\3')
end
def replace_vars(less)