Active
Project:
Omega
Version:
7.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 Oct 2015 at 14:49 UTC
Updated:
27 Mar 2023 at 08:23 UTC
Jump to comment: Most recent
Since Sass 3.4 some of the generated CSS files contains a BOM flag to be compliant with CSS Syntax Module Level 3. The problem is that Drupal's CSS aggregator does not remove that flag. It that case, some CSS rules, often related to webfonts, are not loaded anymore.
An easy hack can be added in the config.rb file to remove the BOM automatically.
# Removes the BOM for UTF-8 stylesheets.
on_stylesheet_saved do |filename|
css = File.open(filename, 'r')
content = css.read
if "UTF-8" == content.encoding.name
content.sub!("\xEF\xBB\xBF".force_encoding("UTF-8"), '')
File.write(filename, content)
end
endAdd this snippet to the base config.rb file.
None.
None.
None.
Comments
Comment #2
duaelfrDrupal 8 manages it in Core #1833356: CSS files encoded in UTF-8 with BOM break the design when enabling CSS aggregation
But while that's not backported to D7 we should have this little fix in our config.rb :)
Comment #3
avpaderno