sass_fix_ie 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ /Gemfile.lock
2
+ *.gem
3
+ .bundle/*
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "sass"
@@ -0,0 +1,33 @@
1
+ SASS Extension to fix display:inline-block on IE
2
+ =================================================
3
+
4
+ It automatically includes ```zoom:1``` and ```*display:inline``` after every ```display: inline-block```.
5
+
6
+ This is to fix the inline-block problem on IE7.
7
+
8
+ Requirement
9
+ -------------------
10
+
11
+ You are using ```sass``` gem or ```sass-rails``` gem
12
+
13
+
14
+ How to use it
15
+ --------------------
16
+
17
+ In your Gemfile:
18
+
19
+ ```
20
+ gem 'sass_fix_ie'
21
+ ```
22
+
23
+
24
+ Author
25
+ --------
26
+
27
+ Tanin Na Nakorn
28
+
29
+
30
+ License
31
+ ---------
32
+
33
+ Do What The Fuck You Want To Public License (http://sam.zoy.org/wtfpl/)
@@ -0,0 +1,16 @@
1
+ require "sass"
2
+
3
+ class Sass::Tree::Visitors::ToCss < Sass::Tree::Visitors::Base
4
+
5
+ def visit_prop_with_ie7(node)
6
+ s = original_visit_prop(node)
7
+
8
+ if node.resolved_name.downcase == "display" and node.resolved_value.downcase == "inline-block"
9
+ s = "#{s};zoom: 1;*display:inline;"
10
+ end
11
+
12
+ s
13
+ end
14
+ alias_method :original_visit_prop, :visit_prop
15
+ alias_method :visit_prop, :visit_prop_with_ie7
16
+ end
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "sass_fix_ie"
6
+ s.version = "0.0.1"
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Tanin Na Nakorn"]
9
+ s.email = ["tanin47@yahoo.com"]
10
+ s.homepage = "http://github.com/tanin47/sass_fix_ie"
11
+ s.summary = %q{SASS extension to fix display: inline-block of IE}
12
+ s.description = %q{It automatically includes zoom:1 and *display:inline for you}
13
+
14
+ s.rubyforge_project = "sass_fix_ie"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ #s.test_files = `git ls-files -- {rails,spec}/*`.split("\n")
18
+ #s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_dependency('sass')
22
+ end
File without changes
data/test.rb ADDED
@@ -0,0 +1,20 @@
1
+ require "rubygems"
2
+ require "bundler/setup"
3
+
4
+ # require your gems as usual
5
+ require "sass"
6
+ require File.expand_path("../sass_fix_ie", __FILE__)
7
+
8
+ css = <<-eos
9
+ .Test {
10
+ .Hello {
11
+ display: inline-block;
12
+ }
13
+ }
14
+ eos
15
+
16
+ puts Sass::Engine.new(css,
17
+ :syntax => :scss,
18
+ :cache => false,
19
+ :read_cache => false,
20
+ :style => {}).render # note: style is set by railtie or by config
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sass_fix_ie
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Tanin Na Nakorn
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: sass
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: It automatically includes zoom:1 and *display:inline for you
31
+ email:
32
+ - tanin47@yahoo.com
33
+ executables: []
34
+ extensions: []
35
+ extra_rdoc_files: []
36
+ files:
37
+ - .gitignore
38
+ - Gemfile
39
+ - README.md
40
+ - lib/sass_fix_ie.rb
41
+ - sass_fix_ie.gemspec
42
+ - sass_fix_ie.rb
43
+ - test.rb
44
+ homepage: http://github.com/tanin47/sass_fix_ie
45
+ licenses: []
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubyforge_project: sass_fix_ie
64
+ rubygems_version: 1.8.24
65
+ signing_key:
66
+ specification_version: 3
67
+ summary: ! 'SASS extension to fix display: inline-block of IE'
68
+ test_files: []