Skip to content

Commit

Permalink
Use import method
Browse files Browse the repository at this point in the history
  • Loading branch information
doabit committed Apr 10, 2014
1 parent 0142ec2 commit b2239d5
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 135 deletions.
12 changes: 2 additions & 10 deletions app/assets/stylesheets/semantic-ui/collections/_form.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@

//= depend_on_asset "semantic-ui/loader-large.gif"
//= depend_on_asset "semantic-ui/loader-mini.gif"
//= depend_on_asset "semantic-ui/loader-small.gif"
//= depend_on_asset "semantic-ui/loader-medium.gif"
//= depend_on_asset "semantic-ui/loader-mini-inverted.gif"
//= depend_on_asset "semantic-ui/loader-small-inverted.gif"
//= depend_on_asset "semantic-ui/loader-medium-inverted.gif"
//= depend_on_asset "semantic-ui/loader-large-inverted.gif"
/*
@import '../depends/loader';
/*
* # Semantic - Form
* http://github.com/jlukic/semantic-ui/
*
Expand Down
12 changes: 2 additions & 10 deletions app/assets/stylesheets/semantic-ui/collections/_menu.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@

//= depend_on_asset "semantic-ui/loader-large.gif"
//= depend_on_asset "semantic-ui/loader-mini.gif"
//= depend_on_asset "semantic-ui/loader-small.gif"
//= depend_on_asset "semantic-ui/loader-medium.gif"
//= depend_on_asset "semantic-ui/loader-mini-inverted.gif"
//= depend_on_asset "semantic-ui/loader-small-inverted.gif"
//= depend_on_asset "semantic-ui/loader-medium-inverted.gif"
//= depend_on_asset "semantic-ui/loader-large-inverted.gif"
/*
@import '../depends/loader';
/*
* # Semantic - Menu
* http://github.com/jlukic/semantic-ui/
*
Expand Down
5 changes: 1 addition & 4 deletions app/assets/stylesheets/semantic-ui/elements/_basic.icon.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
//= depend_on_asset "semantic-ui/basic.icons.eot"
//= depend_on_asset "semantic-ui/basic.icons.svg"
//= depend_on_asset "semantic-ui/basic.icons.woff"
//= depend_on_asset "semantic-ui/basic.icons.ttf"
@import '../depends/basic.icon';
/*
* # Semantic - basic.Icon (Basic)
* http://github.com/jlukic/semantic-ui/
Expand Down
12 changes: 2 additions & 10 deletions app/assets/stylesheets/semantic-ui/elements/_button.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@

//= depend_on_asset "semantic-ui/loader-large.gif"
//= depend_on_asset "semantic-ui/loader-mini.gif"
//= depend_on_asset "semantic-ui/loader-small.gif"
//= depend_on_asset "semantic-ui/loader-medium.gif"
//= depend_on_asset "semantic-ui/loader-mini-inverted.gif"
//= depend_on_asset "semantic-ui/loader-small-inverted.gif"
//= depend_on_asset "semantic-ui/loader-medium-inverted.gif"
//= depend_on_asset "semantic-ui/loader-large-inverted.gif"
/*
@import '../depends/loader';
/*
* # Semantic - Button
* http://github.com/jlukic/semantic-ui/
*
Expand Down
8 changes: 2 additions & 6 deletions app/assets/stylesheets/semantic-ui/elements/_icon.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@

//= depend_on_asset "semantic-ui/icons.eot"
//= depend_on_asset "semantic-ui/icons.svg"
//= depend_on_asset "semantic-ui/icons.woff"
//= depend_on_asset "semantic-ui/icons.ttf"
/*
@import '../depends/icon';
/*
* # Semantic - Icon
* http://github.com/jlukic/semantic-ui/
*
Expand Down
12 changes: 2 additions & 10 deletions app/assets/stylesheets/semantic-ui/elements/_input.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@

//= depend_on_asset "semantic-ui/loader-large.gif"
//= depend_on_asset "semantic-ui/loader-mini.gif"
//= depend_on_asset "semantic-ui/loader-small.gif"
//= depend_on_asset "semantic-ui/loader-medium.gif"
//= depend_on_asset "semantic-ui/loader-mini-inverted.gif"
//= depend_on_asset "semantic-ui/loader-small-inverted.gif"
//= depend_on_asset "semantic-ui/loader-medium-inverted.gif"
//= depend_on_asset "semantic-ui/loader-large-inverted.gif"
/*
@import '../depends/loader';
/*
* # Semantic - Input
* http://github.com/jlukic/semantic-ui/
*
Expand Down
12 changes: 2 additions & 10 deletions app/assets/stylesheets/semantic-ui/elements/_loader.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@

//= depend_on_asset "semantic-ui/loader-large.gif"
//= depend_on_asset "semantic-ui/loader-mini.gif"
//= depend_on_asset "semantic-ui/loader-small.gif"
//= depend_on_asset "semantic-ui/loader-medium.gif"
//= depend_on_asset "semantic-ui/loader-mini-inverted.gif"
//= depend_on_asset "semantic-ui/loader-small-inverted.gif"
//= depend_on_asset "semantic-ui/loader-medium-inverted.gif"
//= depend_on_asset "semantic-ui/loader-large-inverted.gif"
/*
@import '../depends/loader';
/*
* # Semantic - Loader
* http://github.com/jlukic/semantic-ui/
*
Expand Down
12 changes: 2 additions & 10 deletions app/assets/stylesheets/semantic-ui/modules/_search.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@

//= depend_on_asset "semantic-ui/loader-large.gif"
//= depend_on_asset "semantic-ui/loader-mini.gif"
//= depend_on_asset "semantic-ui/loader-small.gif"
//= depend_on_asset "semantic-ui/loader-medium.gif"
//= depend_on_asset "semantic-ui/loader-mini-inverted.gif"
//= depend_on_asset "semantic-ui/loader-small-inverted.gif"
//= depend_on_asset "semantic-ui/loader-medium-inverted.gif"
//= depend_on_asset "semantic-ui/loader-large-inverted.gif"
/*
@import '../depends/loader';
/*
* # Semantic - Search
* http://github.com/jlukic/semantic-ui/
*
Expand Down
12 changes: 2 additions & 10 deletions app/assets/stylesheets/semantic-ui/modules/_tab.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@

//= depend_on_asset "semantic-ui/loader-large.gif"
//= depend_on_asset "semantic-ui/loader-mini.gif"
//= depend_on_asset "semantic-ui/loader-small.gif"
//= depend_on_asset "semantic-ui/loader-medium.gif"
//= depend_on_asset "semantic-ui/loader-mini-inverted.gif"
//= depend_on_asset "semantic-ui/loader-small-inverted.gif"
//= depend_on_asset "semantic-ui/loader-medium-inverted.gif"
//= depend_on_asset "semantic-ui/loader-large-inverted.gif"
/*
@import '../depends/loader';
/*
* # Semantic - Tab
* http://github.com/jlukic/semantic-ui/
*
Expand Down
82 changes: 27 additions & 55 deletions tasks/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,30 @@ class Converter
TOKEN = ENV['TOKEN']
BROWSERS = ['last 2 version', '> 1%', 'opera 12.1', 'safari 6', 'ie 9', 'bb 10', 'android 4']

DEPENDS = {
icon: %Q{
//= depend_on_asset "semantic-ui/icons.eot"
//= depend_on_asset "semantic-ui/icons.svg"
//= depend_on_asset "semantic-ui/icons.woff"
//= depend_on_asset "semantic-ui/icons.ttf"
},
basic_icon: %Q{
//= depend_on_asset "semantic-ui/basic.icons.eot"
//= depend_on_asset "semantic-ui/basic.icons.svg"
//= depend_on_asset "semantic-ui/basic.icons.woff"
//= depend_on_asset "semantic-ui/basic.icons.ttf"
},
loader: %Q{
//= depend_on_asset "semantic-ui/loader-large.gif"
//= depend_on_asset "semantic-ui/loader-mini.gif"
//= depend_on_asset "semantic-ui/loader-small.gif"
//= depend_on_asset "semantic-ui/loader-medium.gif"
//= depend_on_asset "semantic-ui/loader-mini-inverted.gif"
//= depend_on_asset "semantic-ui/loader-small-inverted.gif"
//= depend_on_asset "semantic-ui/loader-medium-inverted.gif"
//= depend_on_asset "semantic-ui/loader-large-inverted.gif"
}
}
# DEPENDS = {
# icon: %Q{
# //= depend_on_asset "semantic-ui/icons.eot"
# //= depend_on_asset "semantic-ui/icons.svg"
# //= depend_on_asset "semantic-ui/icons.woff"
# //= depend_on_asset "semantic-ui/icons.ttf"
# },
# basic_icon: %Q{
# //= depend_on_asset "semantic-ui/basic.icons.eot"
# //= depend_on_asset "semantic-ui/basic.icons.svg"
# //= depend_on_asset "semantic-ui/basic.icons.woff"
# //= depend_on_asset "semantic-ui/basic.icons.ttf"
# },
# loader: %Q{
# //= depend_on_asset "semantic-ui/loader-large.gif"
# //= depend_on_asset "semantic-ui/loader-mini.gif"
# //= depend_on_asset "semantic-ui/loader-small.gif"
# //= depend_on_asset "semantic-ui/loader-medium.gif"
# //= depend_on_asset "semantic-ui/loader-mini-inverted.gif"
# //= depend_on_asset "semantic-ui/loader-small-inverted.gif"
# //= depend_on_asset "semantic-ui/loader-medium-inverted.gif"
# //= depend_on_asset "semantic-ui/loader-large-inverted.gif"
# }
# }

def initialize(branch)
@repo = 'Semantic-Org/Semantic-UI'
Expand All @@ -67,31 +67,6 @@ def process
store_version
end

# def prepare_depend_asset
# icons = %Q{
# //= depend_on_asset "semantic-ui/icons.eot"
# //= depend_on_asset "semantic-ui/icons.svg"
# //= depend_on_asset "semantic-ui/icons.woff"
# //= depend_on_asset "semantic-ui/icons.ttf"
# }
# base_icons = %Q{
# //= depend_on_asset "semantic-ui/basic.icons.eot"
# //= depend_on_asset "semantic-ui/basic.icons.svg"
# //= depend_on_asset "semantic-ui/basic.icons.woff"
# //= depend_on_asset "semantic-ui/basic.icons.ttf"
# }
# loader = %Q{
# //= depend_on_asset "semantic-ui/loader-large.gif"
# //= depend_on_asset "semantic-ui/loader-mini.gif"
# //= depend_on_asset "semantic-ui/loader-small.gif"
# //= depend_on_asset "semantic-ui/loader-medium.gif"
# //= depend_on_asset "semantic-ui/loader-mini-inverted.gif"
# //= depend_on_asset "semantic-ui/loader-small-inverted.gif"
# //= depend_on_asset "semantic-ui/loader-medium-inverted.gif"
# //= depend_on_asset "semantic-ui/loader-large-inverted.gif"
# }
# end

def process_stylesheets_assets
main_content = ''
semantic_ui_less_paths.each do |path, sha|
Expand Down Expand Up @@ -218,13 +193,11 @@ def save_file(name, content, path, type='stylesheets')
# Check depent asset

if name == "icon"
# content = "@import '../depends/icon';\n" + content
content = DEPENDS[:icon] + content
content = "@import '../depends/icon';\n" + content
end

if name == "basic.icon"
# content = "@import '../depends/base.icon';\n" + content
content = DEPENDS[:base_icon] + content
content = "@import '../depends/basic.icon';\n" + content
end

content = check_depend_asset(content)
Expand All @@ -240,8 +213,7 @@ def save_file(name, content, path, type='stylesheets')

def check_depend_asset(content)
if content.scan(/loader-\w+.gif/).length > 0
# "@import '../depends/loader';\n" + content
DEPENDS[:loader] + content
"@import '../depends/loader';\n" + content
else
content
end
Expand Down

0 comments on commit b2239d5

Please sign in to comment.