Fix #4111: Cache custom CSS.
This commit is contained in:
11
app/logical/custom_css.rb
Normal file
11
app/logical/custom_css.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
module CustomCss
|
||||
def self.parse(css)
|
||||
css.to_s.split(/\r\n|\r|\n/).map do |line|
|
||||
if line =~ /\A@import/
|
||||
line
|
||||
else
|
||||
line.gsub(/([^[:space:]])[[:space:]]*(?:!important)?[[:space:]]*(;|})/, "\\1 !important\\2")
|
||||
end
|
||||
end.join("\n")
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user