Created
January 30, 2014 21:19
-
-
Save metaskills/8719936 to your computer and use it in GitHub Desktop.
Few Cleanups To Flat UI Sass For Older Sass Support.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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