Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Few Cleanups To Flat UI Sass For Older Sass Support.
require 'thor'
namespace :flat_ui_pro do
class Hammer < Thor
include Thor::Actions
end
task :thor => ['rake:environment'] do
require 'thor'
end
desc "Cleanup Flat UI Pro conversions."
task :cleanup => :thor do
assets =
hammer :gsub_file, stylesheet('_fonts.scss'), /url\('\.\.\/fonts\/lato/, "font-url('lato"
hammer :gsub_file, stylesheet('_variables.scss'), /\$flat-ui-sass-asset-helper.*function-exists.*;/, ''
hammer :gsub_file, stylesheet('_icon-font.scss'), /\$flat-ui-sass-asset-helper, flat-ui-font-path/, '$bootstrap-sass-asset-helper, twbs-font-path'
['_mixins.scss', 'modules/_switch.scss'].each do |file|
hammer :gsub_file, stylesheet(file), /\$flat-ui-sass-asset-helper, flat-ui-image-path/, '$bootstrap-sass-asset-helper, twbs-font-path'
end
end
private
def hammer(*args)
Hammer.new.send *args
end
def asset(path)
Rails.root.join "vendor/assets/#{path}"
end
def stylesheet(file)
asset "stylesheets/flat-ui-pro/#{file}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.