bootstrap-sass 3.3.1.0 → 3.3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of bootstrap-sass might be problematic. Click here for more details.

Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -3
  3. data/CONTRIBUTING.md +8 -1
  4. data/README.md +30 -36
  5. data/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  6. data/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +273 -214
  7. data/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  8. data/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  9. data/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
  10. data/assets/javascripts/bootstrap.js +1081 -1079
  11. data/assets/javascripts/bootstrap.min.js +7 -0
  12. data/assets/javascripts/bootstrap/affix.js +4 -4
  13. data/assets/javascripts/bootstrap/alert.js +3 -3
  14. data/assets/javascripts/bootstrap/button.js +3 -3
  15. data/assets/javascripts/bootstrap/carousel.js +7 -10
  16. data/assets/javascripts/bootstrap/collapse.js +4 -4
  17. data/assets/javascripts/bootstrap/dropdown.js +3 -3
  18. data/assets/javascripts/bootstrap/modal.js +3 -3
  19. data/assets/javascripts/bootstrap/popover.js +7 -13
  20. data/assets/javascripts/bootstrap/scrollspy.js +3 -3
  21. data/assets/javascripts/bootstrap/tab.js +3 -3
  22. data/assets/javascripts/bootstrap/tooltip.js +10 -16
  23. data/assets/javascripts/bootstrap/transition.js +2 -2
  24. data/assets/stylesheets/_bootstrap-compass.scss +2 -0
  25. data/assets/stylesheets/_bootstrap-mincer.scss +2 -0
  26. data/assets/stylesheets/_bootstrap-sprockets.scss +2 -0
  27. data/assets/stylesheets/bootstrap/_alerts.scss +5 -0
  28. data/assets/stylesheets/bootstrap/_badges.scss +4 -0
  29. data/assets/stylesheets/bootstrap/_breadcrumbs.scss +1 -1
  30. data/assets/stylesheets/bootstrap/_button-groups.scss +2 -2
  31. data/assets/stylesheets/bootstrap/_buttons.scss +1 -1
  32. data/assets/stylesheets/bootstrap/_carousel.scss +8 -6
  33. data/assets/stylesheets/bootstrap/_close.scss +1 -0
  34. data/assets/stylesheets/bootstrap/_dropdowns.scss +2 -1
  35. data/assets/stylesheets/bootstrap/_forms.scss +41 -19
  36. data/assets/stylesheets/bootstrap/_glyphicons.scss +265 -198
  37. data/assets/stylesheets/bootstrap/_jumbotron.scss +1 -0
  38. data/assets/stylesheets/bootstrap/_media.scss +14 -0
  39. data/assets/stylesheets/bootstrap/_navbar.scss +1 -0
  40. data/assets/stylesheets/bootstrap/_panels.scss +5 -1
  41. data/assets/stylesheets/bootstrap/_popovers.scss +1 -1
  42. data/assets/stylesheets/bootstrap/_responsive-utilities.scss +4 -1
  43. data/assets/stylesheets/bootstrap/_tables.scss +3 -3
  44. data/assets/stylesheets/bootstrap/_theme.scss +3 -2
  45. data/assets/stylesheets/bootstrap/_tooltip.scss +1 -1
  46. data/assets/stylesheets/bootstrap/_variables.scss +6 -8
  47. data/assets/stylesheets/bootstrap/mixins/_hide-text.scss +1 -1
  48. data/assets/stylesheets/bootstrap/mixins/_opacity.scss +1 -1
  49. data/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss +1 -1
  50. data/bootstrap-sass.gemspec +2 -2
  51. data/bower.json +3 -13
  52. data/lib/bootstrap-sass.rb +16 -4
  53. data/lib/bootstrap-sass/engine.rb +1 -1
  54. data/lib/bootstrap-sass/version.rb +2 -2
  55. data/package.json +2 -2
  56. data/tasks/bower.rake +1 -4
  57. data/tasks/converter.rb +1 -1
  58. data/tasks/converter/fonts_conversion.rb +1 -1
  59. data/tasks/converter/js_conversion.rb +6 -4
  60. data/tasks/converter/less_conversion.rb +23 -15
  61. data/templates/project/_bootstrap-variables.sass +6 -9
  62. data/templates/project/styles.sass +3 -0
  63. data/test/dummy_rails/config/environments/test.rb +2 -0
  64. data/test/sprockets_rails_test.rb +1 -1
  65. metadata +23 -21
@@ -13,6 +13,7 @@
13
13
  .h1 {
14
14
  color: $jumbotron-heading-color;
15
15
  }
16
+
16
17
  p {
17
18
  margin-bottom: ($jumbotron-padding / 2);
18
19
  font-size: $jumbotron-font-size;
@@ -7,6 +7,20 @@
7
7
  }
8
8
  }
9
9
 
10
+ .media,
11
+ .media-body {
12
+ zoom: 1;
13
+ overflow: hidden;
14
+ }
15
+
16
+ .media-body {
17
+ width: 10000px;
18
+ }
19
+
20
+ .media-object {
21
+ display: block;
22
+ }
23
+
10
24
  .media-right,
11
25
  .media > .pull-right {
12
26
  padding-left: 10px;
@@ -331,6 +331,7 @@
331
331
  }
332
332
  // Menu position and menu caret support for dropups via extra dropup class
333
333
  .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
334
+ margin-bottom: 0;
334
335
  @include border-top-radius($navbar-border-radius);
335
336
  @include border-bottom-radius(0);
336
337
  }
@@ -36,7 +36,11 @@
36
36
  font-size: ceil(($font-size-base * 1.125));
37
37
  color: inherit;
38
38
 
39
- > a {
39
+ > a,
40
+ > small,
41
+ > .small,
42
+ > small > a,
43
+ > .small > a {
40
44
  color: inherit;
41
45
  }
42
46
  }
@@ -11,7 +11,7 @@
11
11
  display: none;
12
12
  max-width: $popover-max-width;
13
13
  padding: 1px;
14
- // Reset font and text propertes given new insertion method
14
+ // Reset font and text properties given new insertion method
15
15
  font-family: $font-family-base;
16
16
  font-size: $font-size-base;
17
17
  font-weight: normal;
@@ -26,7 +26,10 @@
26
26
  // Visibility utilities
27
27
  // Note: Deprecated .visible-xs, .visible-sm, .visible-md, and .visible-lg as of v3.2.0
28
28
 
29
- @include responsive-invisibility('.visible-xs, .visible-sm, .visible-md, .visible-lg');
29
+ @include responsive-invisibility('.visible-xs');
30
+ @include responsive-invisibility('.visible-sm');
31
+ @include responsive-invisibility('.visible-md');
32
+ @include responsive-invisibility('.visible-lg');
30
33
 
31
34
  .visible-xs-block,
32
35
  .visible-xs-inline,
@@ -111,7 +111,7 @@ th {
111
111
  // Default zebra-stripe styles (alternating gray and transparent backgrounds)
112
112
 
113
113
  .table-striped {
114
- > tbody > tr:nth-child(odd) {
114
+ > tbody > tr:nth-of-type(odd) {
115
115
  background-color: $table-bg-accent;
116
116
  }
117
117
  }
@@ -133,7 +133,7 @@ th {
133
133
  // Reset default table behavior
134
134
 
135
135
  table col[class*="col-"] {
136
- position: static; // Prevent border hiding in Firefox and IE9/10 (see https://github.com/twbs/bootstrap/issues/11623)
136
+ position: static; // Prevent border hiding in Firefox and IE9-11 (see https://github.com/twbs/bootstrap/issues/11623)
137
137
  float: none;
138
138
  display: table-column;
139
139
  }
@@ -141,7 +141,7 @@ table {
141
141
  td,
142
142
  th {
143
143
  &[class*="col-"] {
144
- position: static; // Prevent border hiding in Firefox and IE9/10 (see https://github.com/twbs/bootstrap/issues/11623)
144
+ position: static; // Prevent border hiding in Firefox and IE9-11 (see https://github.com/twbs/bootstrap/issues/11623)
145
145
  float: none;
146
146
  display: table-cell;
147
147
  }
@@ -36,7 +36,7 @@
36
36
  // Mixin for generating new styles
37
37
  @mixin btn-styles($btn-color: #555) {
38
38
  @include gradient-vertical($start-color: $btn-color, $end-color: darken($btn-color, 12%));
39
- @include reset-filter; // Disable gradients for IE9 because filter bleeds through rounded corners
39
+ @include reset-filter; // Disable gradients for IE9 because filter bleeds through rounded corners; see https://github.com/twbs/bootstrap/issues/10620
40
40
  background-repeat: repeat-x;
41
41
  border-color: darken($btn-color, 14%);
42
42
 
@@ -52,6 +52,7 @@
52
52
  border-color: darken($btn-color, 14%);
53
53
  }
54
54
 
55
+ &.disabled,
55
56
  &:disabled,
56
57
  &[disabled] {
57
58
  background-color: darken($btn-color, 12%);
@@ -130,7 +131,7 @@
130
131
  // Inverted navbar
131
132
  .navbar-inverse {
132
133
  @include gradient-vertical($start-color: lighten($navbar-inverse-bg, 10%), $end-color: $navbar-inverse-bg);
133
- @include reset-filter; // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered
134
+ @include reset-filter; // Remove gradient in IE<10 to fix bug where dropdowns don't get triggered; see https://github.com/twbs/bootstrap/issues/10257
134
135
 
135
136
  .navbar-nav > .open > a,
136
137
  .navbar-nav > .active > a {
@@ -9,7 +9,7 @@
9
9
  z-index: $zindex-tooltip;
10
10
  display: block;
11
11
  visibility: visible;
12
- // Reset font and text propertes given new insertion method
12
+ // Reset font and text properties given new insertion method
13
13
  font-family: $font-family-base;
14
14
  font-size: $font-size-small;
15
15
  font-weight: normal;
@@ -1,8 +1,4 @@
1
- // When true, asset path helpers are used, otherwise the regular CSS `url()` is used.
2
- // When there no function is defined, `fn('')` is parsed as string that equals the right hand side
3
- // NB: in Sass 3.3 there is a native function: function-exists(twbs-font-path)
4
- $bootstrap-sass-asset-helper: (twbs-font-path("") != unquote('twbs-font-path("")')) !default;
5
-
1
+ $bootstrap-sass-asset-helper: false !default;
6
2
  //
7
3
  // Variables
8
4
  // --------------------------------------------------
@@ -19,7 +15,7 @@ $gray: lighten($gray-base, 33.5%) !default; // #555
19
15
  $gray-light: lighten($gray-base, 46.7%) !default; // #777
20
16
  $gray-lighter: lighten($gray-base, 93.5%) !default; // #eee
21
17
 
22
- $brand-primary: darken(#428bca, 6.5%) !default;
18
+ $brand-primary: darken(#428bca, 6.5%) !default; // #337ab7
23
19
  $brand-success: #5cb85c !default;
24
20
  $brand-info: #5bc0de !default;
25
21
  $brand-warning: #f0ad4e !default;
@@ -82,7 +78,8 @@ $headings-color: inherit !default;
82
78
 
83
79
  //** Load fonts from this directory.
84
80
 
85
- // [converter] Asset helpers such as Sprockets and Node.js Mincer do not resolve relative paths
81
+ // [converter] If $bootstrap-sass-asset-helper if used, provide path relative to the assets load path.
82
+ // [converter] This is because some asset helpers, such as Sprockets, do not work with file-relative paths.
86
83
  $icon-font-path: if($bootstrap-sass-asset-helper, "bootstrap/", "../fonts/bootstrap/") !default;
87
84
 
88
85
  //** File name for all font files.
@@ -107,7 +104,7 @@ $padding-small-horizontal: 10px !default;
107
104
  $padding-xs-vertical: 1px !default;
108
105
  $padding-xs-horizontal: 5px !default;
109
106
 
110
- $line-height-large: 1.33 !default;
107
+ $line-height-large: 1.3333333 !default; // extra decimals for Win 8.1 Chrome
111
108
  $line-height-small: 1.5 !default;
112
109
 
113
110
  $border-radius-base: 4px !default;
@@ -195,6 +192,7 @@ $input-border: #ccc !default;
195
192
 
196
193
  // TODO: Rename `$input-border-radius` to `$input-border-radius-base` in v4
197
194
  //** Default `.form-control` border radius
195
+ // This has no effect on `<select>`s in some browsers, due to the limited stylability of `<select>`s in CSS.
198
196
  $input-border-radius: $border-radius-base !default;
199
197
  //** Large `.form-control` border radius
200
198
  $input-border-radius-large: $border-radius-large !default;
@@ -8,7 +8,7 @@
8
8
 
9
9
  // Deprecated as of v3.0.1 (will be removed in v4)
10
10
  @mixin hide-text() {
11
- font: #{0/0} a;
11
+ font: 0/0 a;
12
12
  color: transparent;
13
13
  text-shadow: none;
14
14
  background-color: transparent;
@@ -4,5 +4,5 @@
4
4
  opacity: $opacity;
5
5
  // IE8 filter
6
6
  $opacity-ie: ($opacity * 100);
7
- filter: #{alpha(opacity=$opacity-ie)};
7
+ filter: alpha(opacity=$opacity-ie);
8
8
  }
@@ -102,7 +102,7 @@
102
102
  // Firefox
103
103
  &::-moz-placeholder {
104
104
  color: $color;
105
- opacity: 1; // See https://github.com/twbs/bootstrap/pull/11526
105
+ opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
106
106
  }
107
107
  &:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
108
108
  &::-webkit-input-placeholder { color: $color; } // Safari and Chrome
@@ -11,7 +11,8 @@ Gem::Specification.new do |s|
11
11
  s.homepage = "https://github.com/twbs/bootstrap-sass"
12
12
  s.license = 'MIT'
13
13
 
14
- s.add_runtime_dependency 'sass', '~> 3.2'
14
+ s.add_runtime_dependency 'sass', '>= 3.2.19'
15
+ s.add_runtime_dependency 'autoprefixer-rails', '>= 5.0.0.1'
15
16
 
16
17
  # Testing dependencies
17
18
  s.add_development_dependency 'minitest', '~> 5.4.0'
@@ -24,7 +25,6 @@ Gem::Specification.new do |s|
24
25
  s.add_development_dependency 'activesupport', '>= 4.1.5'
25
26
  s.add_development_dependency 'json', '>= 1.8.1'
26
27
  s.add_development_dependency 'sprockets-rails', '>= 2.1.3'
27
- s.add_development_dependency 'autoprefixer-rails', '~> 1.1'
28
28
  s.add_development_dependency 'jquery-rails', '>= 3.1.0'
29
29
  s.add_development_dependency 'slim-rails'
30
30
  s.add_development_dependency 'uglifier'
data/bower.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bootstrap-sass",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "homepage": "https://github.com/twbs/bootstrap-sass",
5
5
  "authors": [
6
6
  "Thomas McDonald",
@@ -15,18 +15,8 @@
15
15
  "assets/fonts/bootstrap/glyphicons-halflings-regular.svg",
16
16
  "assets/fonts/bootstrap/glyphicons-halflings-regular.ttf",
17
17
  "assets/fonts/bootstrap/glyphicons-halflings-regular.woff",
18
- "assets/javascripts/bootstrap/affix.js",
19
- "assets/javascripts/bootstrap/alert.js",
20
- "assets/javascripts/bootstrap/button.js",
21
- "assets/javascripts/bootstrap/carousel.js",
22
- "assets/javascripts/bootstrap/collapse.js",
23
- "assets/javascripts/bootstrap/dropdown.js",
24
- "assets/javascripts/bootstrap/tab.js",
25
- "assets/javascripts/bootstrap/transition.js",
26
- "assets/javascripts/bootstrap/scrollspy.js",
27
- "assets/javascripts/bootstrap/modal.js",
28
- "assets/javascripts/bootstrap/tooltip.js",
29
- "assets/javascripts/bootstrap/popover.js"
18
+ "assets/fonts/bootstrap/glyphicons-halflings-regular.woff2",
19
+ "assets/javascripts/bootstrap.js"
30
20
  ],
31
21
  "keywords": [
32
22
  "twbs",
@@ -4,7 +4,13 @@ module Bootstrap
4
4
  # Inspired by Kaminari
5
5
  def load!
6
6
  register_compass_extension if compass?
7
- register_rails_engine if rails?
7
+
8
+ if rails?
9
+ register_rails_engine
10
+ elsif sprockets?
11
+ register_sprockets
12
+ end
13
+
8
14
  configure_sass
9
15
  end
10
16
 
@@ -30,7 +36,7 @@ module Bootstrap
30
36
  end
31
37
 
32
38
  # Environment detection helpers
33
- def asset_pipeline?
39
+ def sprockets?
34
40
  defined?(::Sprockets)
35
41
  end
36
42
 
@@ -49,8 +55,8 @@ module Bootstrap
49
55
 
50
56
  ::Sass.load_paths << stylesheets_path
51
57
 
52
- # bootstrap requires minimum precision of 10, see https://github.com/twbs/bootstrap-sass/issues/409
53
- ::Sass::Script::Number.precision = [10, ::Sass::Script::Number.precision].max
58
+ # bootstrap requires minimum precision of 8, see https://github.com/twbs/bootstrap-sass/issues/409
59
+ ::Sass::Script::Number.precision = [8, ::Sass::Script::Number.precision].max
54
60
  end
55
61
 
56
62
  def register_compass_extension
@@ -66,6 +72,12 @@ module Bootstrap
66
72
  def register_rails_engine
67
73
  require 'bootstrap-sass/engine'
68
74
  end
75
+
76
+ def register_sprockets
77
+ Sprockets.append_path(stylesheets_path)
78
+ Sprockets.append_path(fonts_path)
79
+ Sprockets.append_path(javascripts_path)
80
+ end
69
81
  end
70
82
  end
71
83
 
@@ -5,7 +5,7 @@ module Bootstrap
5
5
  %w(stylesheets javascripts fonts images).each do |sub|
6
6
  app.config.assets.paths << root.join('assets', sub).to_s
7
7
  end
8
- app.config.assets.precompile << %r(bootstrap/glyphicons-halflings-regular\.(?:eot|svg|ttf|woff)$)
8
+ app.config.assets.precompile << %r(bootstrap/glyphicons-halflings-regular\.(?:eot|svg|ttf|woff2?)$)
9
9
  end
10
10
  end
11
11
  end
@@ -1,4 +1,4 @@
1
1
  module Bootstrap
2
- VERSION = '3.3.1.0'
3
- BOOTSTRAP_SHA = '9a7e365c2c4360335d25246dac11afb1f577210a'
2
+ VERSION = '3.3.2.0'
3
+ BOOTSTRAP_SHA = 'bcf7dd38b5ab180256e2e4fb5da0369551b3f082'
4
4
  end
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "bootstrap-sass",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "description": "bootstrap-sass is a Sass-powered version of Bootstrap, ready to drop right into your Sass powered applications.",
5
- "main": "index.js",
5
+ "main": "assets/javascripts/bootstrap.js",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git://github.com/twbs/bootstrap-sass"
@@ -15,14 +15,11 @@ namespace :bower do
15
15
  require 'bootstrap-sass'
16
16
  Dir.chdir Bootstrap.gem_path do
17
17
  spec = JSON.parse(File.read 'bower.json')
18
- js_paths = File.read(File.join Bootstrap.javascripts_path, 'bootstrap-sprockets.js').lines.map do |line|
19
- line.strip if line.sub!(%r(//\s*=\s*require\s*(?:./)?(.*)\s*), 'assets/javascripts/\1.js')
20
- end.compact
21
18
 
22
19
  spec['main'] =
23
20
  find_files.(File.join(Bootstrap.stylesheets_path, '_bootstrap.scss')) +
24
21
  find_files.(Bootstrap.fonts_path) +
25
- js_paths
22
+ %w(assets/javascripts/bootstrap.js)
26
23
 
27
24
  spec['version'] = Bootstrap::VERSION[0..-3]
28
25
 
@@ -50,7 +50,7 @@ class Converter
50
50
  def_delegators :@logger, :log, :log_status, :log_processing, :log_transform, :log_file_info, :log_processed, :log_http_get_file, :log_http_get_files, :silence_log
51
51
 
52
52
  def process_bootstrap
53
- log_status "Convert Bootstrap LESS to SASS"
53
+ log_status "Convert Bootstrap LESS to Sass"
54
54
  puts " repo : #@repo_url"
55
55
  puts " branch : #@branch_sha #@repo_url/tree/#@branch"
56
56
  puts " save to: #{@save_to.to_json}"
@@ -10,7 +10,7 @@ class Converter
10
10
  end
11
11
 
12
12
  def bootstrap_font_files
13
- @bootstrap_font_files ||= get_paths_by_type('fonts', /\.(eot|svg|ttf|woff)$/)
13
+ @bootstrap_font_files ||= get_paths_by_type('fonts', /\.(eot|svg|ttf|woff2?)$/)
14
14
  end
15
15
  end
16
16
  end
@@ -12,14 +12,16 @@ class Converter
12
12
 
13
13
  log_status 'Updating javascript manifest'
14
14
  manifest = ''
15
- cat = ''
16
15
  bootstrap_js_files.each do |name|
17
- cat << contents[name] + "\n"
18
16
  name = name.gsub(/\.js$/, '')
19
17
  manifest << "//= require ./bootstrap/#{name}\n"
20
18
  end
21
- {'assets/javascripts/bootstrap-sprockets.js' => manifest,
22
- 'assets/javascripts/bootstrap.js' => cat}.each do |path, content|
19
+ dist_js = read_files('dist/js', %w(bootstrap.js bootstrap.min.js))
20
+ {
21
+ 'assets/javascripts/bootstrap-sprockets.js' => manifest,
22
+ 'assets/javascripts/bootstrap.js' => dist_js['bootstrap.js'],
23
+ 'assets/javascripts/bootstrap.min.js' => dist_js['bootstrap.min.js'],
24
+ }.each do |path, content|
23
25
  save_file path, content
24
26
  log_processed path
25
27
  end
@@ -95,14 +95,10 @@ class Converter
95
95
  file = apply_mixin_parent_selector file, '\.(?:visible|hidden)'
96
96
  when 'variables.less'
97
97
  file = insert_default_vars(file)
98
- file = unindent <<-SCSS + "\n" + file, 14
99
- // When true, asset path helpers are used, otherwise the regular CSS `url()` is used.
100
- // When there no function is defined, `fn('')` is parsed as string that equals the right hand side
101
- // NB: in Sass 3.3 there is a native function: function-exists(twbs-font-path)
102
- $bootstrap-sass-asset-helper: #{sass_fn_exists('twbs-font-path')} !default;
103
- SCSS
98
+ file = ['$bootstrap-sass-asset-helper: false !default;', file].join("\n")
104
99
  file = replace_all file, %r{(\$icon-font-path): \s*"(.*)" (!default);}, "\n" + unindent(<<-SCSS, 14)
105
- // [converter] Asset helpers such as Sprockets and Node.js Mincer do not resolve relative paths
100
+ // [converter] If $bootstrap-sass-asset-helper if used, provide path relative to the assets load path.
101
+ // [converter] This is because some asset helpers, such as Sprockets, do not work with file-relative paths.
106
102
  \\1: if($bootstrap-sass-asset-helper, "bootstrap/", "\\2bootstrap/") \\3;
107
103
  SCSS
108
104
  when 'close.less'
@@ -114,6 +110,9 @@ class Converter
114
110
  when 'forms.less'
115
111
  file = extract_nested_rule file, 'textarea&'
116
112
  file = apply_mixin_parent_selector(file, '\.input-(?:sm|lg)')
113
+ file = replace_rules file, /\.form-group-(?:sm|lg)/ do |rule|
114
+ apply_mixin_parent_selector rule, '.form-control'
115
+ end
117
116
  when 'navbar.less'
118
117
  file = replace_all file, /(\s*)\.navbar-(right|left)\s*\{\s*@extend\s*\.pull-(right|left);\s*/, "\\1.navbar-\\2 {\\1 float: \\2 !important;\\1"
119
118
  when 'tables.less'
@@ -146,7 +145,7 @@ class Converter
146
145
  # generate variables template
147
146
  save_file 'templates/project/_bootstrap-variables.sass',
148
147
  "// Override Bootstrap variables here (defaults from bootstrap-sass v#{Bootstrap::VERSION}):\n\n" +
149
- File.read("#{save_to}/_variables.scss").gsub(/^(?=\$)/, '// ').gsub(/ !default;/, '')
148
+ File.read("#{save_to}/_variables.scss").lines[1..-1].join.gsub(/^(?=\$)/, '// ').gsub(/ !default;/, '')
150
149
  end
151
150
 
152
151
  def bootstrap_less_files
@@ -171,6 +170,7 @@ class Converter
171
170
  file = deinterpolate_vararg_mixins(file)
172
171
  file = replace_calculation_semantics(file)
173
172
  file = replace_file_imports(file)
173
+ file = unquote_utf8_escape_sequences(file)
174
174
  file
175
175
  end
176
176
 
@@ -206,7 +206,7 @@ class Converter
206
206
  SASS
207
207
  end
208
208
 
209
- # convert grid mixins LESS when => SASS @if
209
+ # convert grid mixins LESS when => Sass @if
210
210
  def convert_grid_mixins(file)
211
211
  file = replace_rules file, /@mixin make-grid-columns/, comments: false do |css, pos|
212
212
  mixin_all_grid_columns css, selector: '.col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}', to: '$grid-columns'
@@ -263,8 +263,8 @@ SASS
263
263
 
264
264
  # margin: a -b
265
265
  # LESS: sets 2 values
266
- # SASS: sets 1 value (a-b)
267
- # This wraps a and -b so they evaluates to 2 values in SASS
266
+ # Sass: sets 1 value (a-b)
267
+ # This wraps a and -b so they evaluates to 2 values in Sass
268
268
  def replace_calculation_semantics(file)
269
269
  # split_prop_val.call('(@navbar-padding-vertical / 2) -@navbar-padding-horizontal')
270
270
  # #=> ["(navbar-padding-vertical / 2)", "-navbar-padding-horizontal"]
@@ -315,6 +315,12 @@ SASS
315
315
  %Q(@import "#{target_path}\\1";)
316
316
  end
317
317
 
318
+ # Unquote escape sequences, e.g. content: "#{$sep}\00a0" to content: #{$sep}\00a0
319
+ # Works around Sass 3.4 issue: https://github.com/sass/sass/issues/1395
320
+ def unquote_utf8_escape_sequences(scss)
321
+ scss.gsub /\"((?:#\{[^}]+\})?\\[a-f0-9]{4,}?)\"/, '\1'
322
+ end
323
+
318
324
  def replace_all(file, regex, replacement = nil, &block)
319
325
  log_transform regex, replacement
320
326
  new_file = file.gsub(regex, replacement, &block)
@@ -384,8 +390,10 @@ SASS
384
390
  end
385
391
  # unwrap, and replace @include
386
392
  unindent unwrap_rule_block(rule).gsub(/(@include [\w-]+)\(?([\$\w\-,\s]*)\)?/) {
387
- args = $2
388
- "#{cmt}#{$1}('#{sel.gsub(/\s+/, ' ')}'#{', ' if args && !args.empty?}#{args})"
393
+ name, args = $1, $2
394
+ sel.gsub(/\s+/, ' ').split(/,\s*/ ).map { |sel_part|
395
+ "#{cmt}#{name}('#{sel_part}'#{', ' if args && !args.empty?}#{args})"
396
+ }.join(";\n")
389
397
  }
390
398
  end
391
399
  end
@@ -449,7 +457,7 @@ SASS
449
457
  end
450
458
  end
451
459
 
452
- # change Microsoft filters to SASS calling convention
460
+ # change Microsoft filters to Sass calling convention
453
461
  def replace_ms_filters(file)
454
462
  log_transform
455
463
  file.gsub(
@@ -497,7 +505,7 @@ SASS
497
505
  end
498
506
 
499
507
  def replace_escaping(less)
500
- less = less.gsub(/~"([^"]+)"/, '#{\1}') # Get rid of ~"" escape
508
+ less = less.gsub(/~"([^"]+)"/, '\1').gsub(/~'([^']+)'/, '\1') # Get rid of ~"" escape
501
509
  less.gsub!(/\$\{([^}]+)\}/, '$\1') # Get rid of @{} escape
502
510
  less.gsub!(/"([^"\n]*)(\$[\w\-]+)([^"\n]*)"/, '"\1#{\2}\3"') # interpolate variable in string, e.g. url("$file-1x") => url("#{$file-1x}")
503
511
  less.gsub(/(\W)e\(%\("?([^"]*)"?\)\)/, '\1\2') # Get rid of e(%("")) escape