Skip to content

Instantly share code, notes, and snippets.

@metaskills
Created January 30, 2014 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metaskills/8719936 to your computer and use it in GitHub Desktop.
Save metaskills/8719936 to your computer and use it in GitHub Desktop.
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