compass_twitter_bootstrap 2.0.3 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. data/CHANGELOG.md +6 -0
  2. data/README.md +41 -7
  3. data/build/convert.rb +27 -11
  4. data/lib/compass_twitter_bootstrap/version.rb +1 -1
  5. data/stylesheets/_compass_twitter_bootstrap.scss +2 -1
  6. data/stylesheets/_compass_twitter_bootstrap_awesome.scss +1 -1
  7. data/stylesheets/_compass_twitter_bootstrap_responsive.scss +1 -1
  8. data/stylesheets/compass_twitter_bootstrap/_accordion.scss +4 -3
  9. data/stylesheets/compass_twitter_bootstrap/_alerts.scss +31 -10
  10. data/stylesheets/compass_twitter_bootstrap/_breadcrumbs.scss +14 -14
  11. data/stylesheets/compass_twitter_bootstrap/_button-groups.scss +91 -55
  12. data/stylesheets/compass_twitter_bootstrap/_buttons.scss +126 -84
  13. data/stylesheets/compass_twitter_bootstrap/_carousel.scss +33 -23
  14. data/stylesheets/compass_twitter_bootstrap/_close.scss +7 -5
  15. data/stylesheets/compass_twitter_bootstrap/_code.scss +12 -8
  16. data/stylesheets/compass_twitter_bootstrap/_component-animations.scss +9 -7
  17. data/stylesheets/compass_twitter_bootstrap/_dropdowns.scss +112 -22
  18. data/stylesheets/compass_twitter_bootstrap/_font-awesome.scss +258 -196
  19. data/stylesheets/compass_twitter_bootstrap/_forms.scss +262 -161
  20. data/stylesheets/compass_twitter_bootstrap/_grid.scss +18 -2
  21. data/stylesheets/compass_twitter_bootstrap/_hero-unit.scss +11 -8
  22. data/stylesheets/compass_twitter_bootstrap/_labels-badges.scss +42 -26
  23. data/stylesheets/compass_twitter_bootstrap/_layouts.scss +3 -4
  24. data/stylesheets/compass_twitter_bootstrap/_media.scss +55 -0
  25. data/stylesheets/compass_twitter_bootstrap/_mixins.scss +243 -189
  26. data/stylesheets/compass_twitter_bootstrap/_modals.scss +28 -23
  27. data/stylesheets/compass_twitter_bootstrap/_navbar.scss +269 -143
  28. data/stylesheets/compass_twitter_bootstrap/_navs.scss +59 -46
  29. data/stylesheets/compass_twitter_bootstrap/_pager.scss +17 -12
  30. data/stylesheets/compass_twitter_bootstrap/_pagination.scss +92 -27
  31. data/stylesheets/compass_twitter_bootstrap/_popovers.scss +116 -36
  32. data/stylesheets/compass_twitter_bootstrap/_progress-bars.scss +35 -30
  33. data/stylesheets/compass_twitter_bootstrap/_reset.scss +101 -11
  34. data/stylesheets/compass_twitter_bootstrap/_responsive-1200px-min.scss +9 -7
  35. data/stylesheets/compass_twitter_bootstrap/_responsive-767px-max.scss +115 -71
  36. data/stylesheets/compass_twitter_bootstrap/_responsive-768px-979px.scss +8 -6
  37. data/stylesheets/compass_twitter_bootstrap/_responsive-navbar.scss +53 -14
  38. data/stylesheets/compass_twitter_bootstrap/_responsive-utilities.scss +17 -15
  39. data/stylesheets/compass_twitter_bootstrap/_responsive.scss +48 -0
  40. data/stylesheets/compass_twitter_bootstrap/_scaffolding.scss +27 -4
  41. data/stylesheets/compass_twitter_bootstrap/_sprites.scss +24 -22
  42. data/stylesheets/compass_twitter_bootstrap/_tables.scss +122 -61
  43. data/stylesheets/compass_twitter_bootstrap/_thumbnails.scss +12 -7
  44. data/stylesheets/compass_twitter_bootstrap/_tooltip.scss +50 -15
  45. data/stylesheets/compass_twitter_bootstrap/_type.scss +93 -93
  46. data/stylesheets/compass_twitter_bootstrap/_utilities.scss +9 -2
  47. data/stylesheets/compass_twitter_bootstrap/_variables.scss +134 -38
  48. data/stylesheets/compass_twitter_bootstrap/_wells.scss +11 -10
  49. data/stylesheets_sass/_compass_twitter_bootstrap.sass +2 -1
  50. data/stylesheets_sass/_compass_twitter_bootstrap_awesome.sass +1 -1
  51. data/stylesheets_sass/_compass_twitter_bootstrap_responsive.sass +1 -1
  52. data/stylesheets_sass/compass_twitter_bootstrap/_accordion.sass +4 -3
  53. data/stylesheets_sass/compass_twitter_bootstrap/_alerts.sass +27 -9
  54. data/stylesheets_sass/compass_twitter_bootstrap/_breadcrumbs.sass +12 -13
  55. data/stylesheets_sass/compass_twitter_bootstrap/_button-groups.sass +93 -55
  56. data/stylesheets_sass/compass_twitter_bootstrap/_buttons.sass +113 -88
  57. data/stylesheets_sass/compass_twitter_bootstrap/_carousel.sass +31 -23
  58. data/stylesheets_sass/compass_twitter_bootstrap/_close.sass +5 -4
  59. data/stylesheets_sass/compass_twitter_bootstrap/_code.sass +12 -9
  60. data/stylesheets_sass/compass_twitter_bootstrap/_component-animations.sass +7 -6
  61. data/stylesheets_sass/compass_twitter_bootstrap/_dropdowns.sass +105 -21
  62. data/stylesheets_sass/compass_twitter_bootstrap/_font-awesome.sass +228 -31
  63. data/stylesheets_sass/compass_twitter_bootstrap/_forms.sass +255 -155
  64. data/stylesheets_sass/compass_twitter_bootstrap/_grid.sass +16 -2
  65. data/stylesheets_sass/compass_twitter_bootstrap/_hero-unit.sass +10 -7
  66. data/stylesheets_sass/compass_twitter_bootstrap/_labels-badges.sass +38 -31
  67. data/stylesheets_sass/compass_twitter_bootstrap/_layouts.sass +3 -4
  68. data/stylesheets_sass/compass_twitter_bootstrap/_media.sass +48 -0
  69. data/stylesheets_sass/compass_twitter_bootstrap/_mixins.sass +215 -174
  70. data/stylesheets_sass/compass_twitter_bootstrap/_modals.sass +25 -26
  71. data/stylesheets_sass/compass_twitter_bootstrap/_navbar.sass +229 -134
  72. data/stylesheets_sass/compass_twitter_bootstrap/_navs.sass +53 -46
  73. data/stylesheets_sass/compass_twitter_bootstrap/_pager.sass +16 -12
  74. data/stylesheets_sass/compass_twitter_bootstrap/_pagination.sass +78 -23
  75. data/stylesheets_sass/compass_twitter_bootstrap/_popovers.sass +106 -40
  76. data/stylesheets_sass/compass_twitter_bootstrap/_progress-bars.sass +35 -30
  77. data/stylesheets_sass/compass_twitter_bootstrap/_reset.sass +80 -12
  78. data/stylesheets_sass/compass_twitter_bootstrap/_responsive-1200px-min.sass +8 -7
  79. data/stylesheets_sass/compass_twitter_bootstrap/_responsive-767px-max.sass +89 -54
  80. data/stylesheets_sass/compass_twitter_bootstrap/_responsive-768px-979px.sass +7 -6
  81. data/stylesheets_sass/compass_twitter_bootstrap/_responsive-navbar.sass +38 -13
  82. data/stylesheets_sass/compass_twitter_bootstrap/_responsive-utilities.sass +18 -17
  83. data/stylesheets_sass/compass_twitter_bootstrap/_responsive.sass +44 -0
  84. data/stylesheets_sass/compass_twitter_bootstrap/_scaffolding.sass +24 -4
  85. data/stylesheets_sass/compass_twitter_bootstrap/_sprites.sass +25 -8
  86. data/stylesheets_sass/compass_twitter_bootstrap/_tables.sass +110 -83
  87. data/stylesheets_sass/compass_twitter_bootstrap/_thumbnails.sass +11 -7
  88. data/stylesheets_sass/compass_twitter_bootstrap/_tooltip.sass +43 -19
  89. data/stylesheets_sass/compass_twitter_bootstrap/_type.sass +123 -75
  90. data/stylesheets_sass/compass_twitter_bootstrap/_utilities.sass +7 -2
  91. data/stylesheets_sass/compass_twitter_bootstrap/_variables.sass +141 -37
  92. data/stylesheets_sass/compass_twitter_bootstrap/_wells.sass +10 -9
  93. data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
  94. data/vendor/assets/fonts/fontawesome-webfont.svg +247 -167
  95. data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
  96. data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
  97. data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
  98. data/vendor/assets/images/glyphicons-halflings.png +0 -0
  99. data/vendor/assets/javascripts/bootstrap-affix.js +117 -0
  100. data/vendor/assets/javascripts/bootstrap-alert.js +13 -4
  101. data/vendor/assets/javascripts/bootstrap-all.js +2 -1
  102. data/vendor/assets/javascripts/bootstrap-button.js +17 -8
  103. data/vendor/assets/javascripts/bootstrap-carousel.js +30 -14
  104. data/vendor/assets/javascripts/bootstrap-collapse.js +24 -14
  105. data/vendor/assets/javascripts/bootstrap-dropdown.js +80 -19
  106. data/vendor/assets/javascripts/bootstrap-modal.js +111 -84
  107. data/vendor/assets/javascripts/bootstrap-popover.js +21 -5
  108. data/vendor/assets/javascripts/bootstrap-scrollspy.js +21 -10
  109. data/vendor/assets/javascripts/bootstrap-tab.js +17 -8
  110. data/vendor/assets/javascripts/bootstrap-tooltip.js +36 -24
  111. data/vendor/assets/javascripts/bootstrap-transition.js +6 -7
  112. data/vendor/assets/javascripts/bootstrap-typeahead.js +87 -49
  113. metadata +17 -7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Overview
2
2
 
3
+ ## 2.2.2
4
+ * Upgraded twiter bootstrap to 2.2.2 (@tijsverkoyen)
5
+
6
+ ## 2.1.0
7
+ * Upgrade twitter bootstrap to 2.1.0 in the scss files (@kristianmandrup)
8
+
3
9
  ## 2.0.1.2
4
10
  * Really fix sprites, maybe.
5
11
  * Update JS
data/README.md CHANGED
@@ -28,12 +28,9 @@ Demo App at https://github.com/vwall/Compass-Twitter-Bootstrap-Demo-App
28
28
 
29
29
  ## Usage with asset pipeline(Rails 3.2)
30
30
 
31
- **Add it to your Gemfile**
31
+ **Add these gems to your Gemfile. To learn about the new compass-rails gem, see https://github.com/Compass/compass-rails for more info.**
32
32
 
33
33
  gem 'compass_twitter_bootstrap'
34
-
35
- **Use the new compass-rails gem. See https://github.com/Compass/compass-rails for more info.**
36
-
37
34
  gem 'compass-rails'
38
35
 
39
36
  **Bundle install**
@@ -41,7 +38,7 @@ Demo App at https://github.com/vwall/Compass-Twitter-Bootstrap-Demo-App
41
38
  bundle install
42
39
 
43
40
  **Add it to your Application.rb**
44
-
41
+
45
42
  # Enable the asset pipeline
46
43
  config.assets.enabled = true
47
44
 
@@ -65,7 +62,7 @@ Demo App at https://github.com/vwall/Compass-Twitter-Bootstrap-Demo-App
65
62
  Rails.configuration.sass.tap do |config|
66
63
  ...
67
64
 
68
- # twitter bootstrap
65
+ # twitter bootstrap
69
66
  config.load_paths << Compass::Frameworks['twitter_bootstrap'].stylesheets_directory
70
67
 
71
68
  ...
@@ -86,12 +83,49 @@ To use the font awesome font and icons simply change the standard import to:
86
83
 
87
84
  Javascript Libraries are located in vendor/assets/javascripts
88
85
 
89
- Include them individually or
86
+ Include them individually or
90
87
 
91
88
  //=require bootstrap-all
92
89
 
93
90
  to include all files
94
91
 
92
+ ## SCSS to SASS Conversion tip
93
+
94
+ To easily convert `.scss` files to `.sass` files you can use this little bash script:
95
+
96
+ `$ for f in *.scss; do sass-convert -F scss -T sass $f ${f%%.*}.sass; done`
97
+
98
+ To convert all twitter bootstrap .scss files to .sass (with overwrite):
99
+
100
+ `$ for f in stylesheets/compass_twitter_bootstrap/*.scss; do sass-convert -F scss -T sass $f stylesheets_sass/compass_twitter_bootstrap/${f%%.*}.sass; done`
101
+
102
+ `$ for f in stylesheets/*.scss; do sass-convert -F scss -T sass $f stylesheets_sass/${f%%.*}.sass; done`
103
+
104
+ Nice and easy :)
105
+
106
+ ## Upgrading
107
+
108
+ If you want to contribute and help out keeping this gem in sync with the latest release of Twitter Bootstrap, you should keep in mind that all mixins are prefixed with `ctb-`.
109
+ With this prefixed we can't run into problems where the converted less-mixins conflict with native Compass names, parameters, ...
110
+
111
+ There is a Rake-task that will help you to fetch all recent changes from the Twitter Bootstrap master:
112
+
113
+ `rake convert`
114
+
115
+ When that is done
116
+
117
+ * update the assets
118
+ * replace `$media ` with @media `, `$page ` with @page `, `$-ms-keyframes ` with @-ms-keyframes `, `$-o-keyframes ` with @-o-keyframes `, see https://github.com/vwall/compass-twitter-bootstrap/issues/100.
119
+ * replace `ctb-reset-filter(` with `ctb-gradient-reset-filter(`
120
+ * replace `ctb-span(` with `ctb-core-span(`
121
+ * replace `@include ctb-opacity(100)` with `@include ctb-opacity(1)` as seen in https://github.com/vwall/compass-twitter-bootstrap/commit/b80ea1bc20f031a4abad7906ba14590bccadc74e
122
+ * search for `(e(` and fix it
123
+ * search for `&-` and fix it, see https://github.com/vwall/compass-twitter-bootstrap/issues/101
124
+ * search fo `.navbar-fixed-bottom .container {` and fix it
125
+ * readd the imports into _buttons.scss as seen in https://github.com/vwall/compass-twitter-bootstrap/commit/18d2d061235d5477c3a30beab9f02c7e9387f0c4
126
+
127
+ @remark: if some Ruby-genius wants to automate this feel free
128
+
95
129
 
96
130
  ## TWITTER BOOTSTRAP
97
131
 
data/build/convert.rb CHANGED
@@ -7,7 +7,7 @@ class Convert
7
7
  get_less_files.each do |name|
8
8
  unless ['bootstrap.less', 'responsive.less'].include?(name)
9
9
  file = open_git_file("https://raw.github.com/twitter/bootstrap/master/less/#{name}")
10
- file = convert(file)
10
+ file = convert(file)
11
11
 
12
12
  if name == 'progress-bars.less'
13
13
  file = fix_progress_bar(file)
@@ -23,7 +23,7 @@ class Convert
23
23
 
24
24
  self.create_sass_files
25
25
  end
26
-
26
+
27
27
  def create_sass_files
28
28
  puts 'Creating sass files for testing'
29
29
 
@@ -57,11 +57,12 @@ private
57
57
  def get_less_files
58
58
  files = open("https://api.github.com/repos/twitter/bootstrap/git/trees/#{get_tree_sha}").read
59
59
  files = JSON.parse files
60
- files['tree'].map{|f| f['path']}
60
+ files['tree'].select{|f| f['type'] == 'blob' }.map{|f| f['path'] }
61
61
  end
62
62
 
63
63
 
64
64
  def convert(file)
65
+ file = replace_interpolation(file)
65
66
  file = replace_vars(file)
66
67
  file = replace_fonts(file)
67
68
  file = replace_font_family(file)
@@ -72,6 +73,8 @@ private
72
73
  file = replace_spin(file)
73
74
  file = replace_opacity(file)
74
75
  file = replace_image_urls(file)
76
+ file = replace_image_paths(file)
77
+ file = replace_escaping(file)
75
78
 
76
79
  file
77
80
  end
@@ -88,6 +91,10 @@ private
88
91
  puts "Converted #{name}\n"
89
92
  end
90
93
 
94
+ def replace_interpolation(less)
95
+ less.gsub(/@{([^}]+)}/, '#{$\1}')
96
+ end
97
+
91
98
  def replace_vars(less)
92
99
  less.gsub(/@/, '$')
93
100
  end
@@ -99,15 +106,15 @@ private
99
106
  end
100
107
 
101
108
  def replace_fonts(less)
102
- less.gsub(/#font \> \.([\w-]+)/, '@include font-\1')
109
+ less.gsub(/#font \> \.([\w-]+)/, '@include ctb-font-\1')
103
110
  end
104
111
 
105
112
  def replace_font_family(less)
106
- less.gsub(/#font \> #family \> \.([\w-]+)/, '@include font-family-\1')
113
+ less.gsub(/#font \> #family \> \.([\w-]+)/, '@include ctb-font-family-\1')
107
114
  end
108
115
 
109
116
  def replace_grads(less)
110
- less.gsub(/#gradient \> \.([\w-]+)/, '@include gradient-\1')
117
+ less.gsub(/#gradient \> \.([\w-]+)/, '@include ctb-gradient-\1')
111
118
  end
112
119
 
113
120
  def replace_mixins(less)
@@ -115,11 +122,11 @@ private
115
122
  end
116
123
 
117
124
  def replace_includes(less)
118
- less.gsub(/\.([\w-]*)(\(.*\));?/, '@include \1\2;')
125
+ less.gsub(/\.([\w-]*)(\(.*\));?/, '@include ctb-\1\2;')
119
126
  end
120
127
 
121
128
  def replace_less_extend(less)
122
- less.gsub(/\#(\w+) \> \.([\w-]*)(\(.*\));?/, '@include \1-\2\3;')
129
+ less.gsub(/\#(\w+) \> \.([\w-]*)(\(.*\));?/, '@include ctb-\1-\2\3;')
123
130
  end
124
131
 
125
132
  def replace_spin(less)
@@ -127,11 +134,20 @@ private
127
134
  end
128
135
 
129
136
  def replace_opacity(scss)
130
- scss.gsub(/\@include opacity\((\d+)\)/) {|s| "@include opacity(#{$1.to_f / 100})"}
137
+ scss.gsub(/\@include opacity\((\d+)\)/) {|s| "@include ctb-opacity(#{$1.to_f / 100})"}
131
138
  end
132
139
 
133
140
  def replace_image_urls(less)
134
- less.gsub(/background-image: url\((.*)\);/) {|s| "background-image: image-url(\"#{$1.gsub('../img/','')}\");" }
141
+ less.gsub(/background-image: url\("?(.*?)"?\);/) {|s| "background-image: image-url(\"#{$1}\");" }
142
+ end
143
+
144
+ def replace_image_paths(less)
145
+ less.gsub('../img/', '')
146
+ end
147
+
148
+ def replace_escaping(less)
149
+ less = less.gsub(/\~"([^"]+)"/, '#{\1}') # Get rid of ~ escape
150
+ less.gsub(/(\W)e\("([^\)]+)"\)/) {|s| "#{$1 if $1 != /\s/}#{$2}"} # Get rid of e escape
135
151
  end
136
152
 
137
153
  def insert_default_vars(scss)
@@ -145,4 +161,4 @@ private
145
161
 
146
162
  end
147
163
 
148
- Convert.new.process
164
+ Convert.new.process
@@ -1,3 +1,3 @@
1
1
  module CompassTwitterBootstrap
2
- VERSION = "2.0.3"
2
+ VERSION = "2.2.2"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap v2.0.3
2
+ * Bootstrap v2.1.0
3
3
  *
4
4
  * Copyright 2012 Twitter, Inc
5
5
  * Licensed under the Apache License v2.0
@@ -56,6 +56,7 @@
56
56
 
57
57
  // Components: Misc
58
58
  @import "compass_twitter_bootstrap/thumbnails";
59
+ @import "compass_twitter_bootstrap/media";
59
60
  @import "compass_twitter_bootstrap/labels-badges";
60
61
  @import "compass_twitter_bootstrap/progress-bars";
61
62
  @import "compass_twitter_bootstrap/accordion";
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Bootstrap v2.0.3
2
+ * Bootstrap v2.1.0
3
3
  *
4
4
  * Copyright 2012 Twitter, Inc
5
5
  * Licensed under the Apache License v2.0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap Responsive v2.0.3
2
+ * Bootstrap Responsive v2.1.0
3
3
  *
4
4
  * Copyright 2012 Twitter, Inc
5
5
  * Licensed under the Apache License v2.0
@@ -1,5 +1,6 @@
1
- // ACCORDION
2
- // ---------
1
+ //
2
+ // Accordion
3
+ // --------------------------------------------------
3
4
 
4
5
 
5
6
  // Parent container
@@ -11,7 +12,7 @@
11
12
  .accordion-group {
12
13
  margin-bottom: 2px;
13
14
  border: 1px solid #e5e5e5;
14
- @include bootstrap-border-radius(4px);
15
+ @include ctb-border-radius($baseBorderRadius);
15
16
  }
16
17
  .accordion-heading {
17
18
  border-bottom: 0;
@@ -1,18 +1,26 @@
1
- // ALERT STYLES
2
- // ------------
1
+ //
2
+ // Alerts
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Base styles
7
+ // -------------------------
3
8
 
4
- // Base alert styles
5
9
  .alert {
6
10
  padding: 8px 35px 8px 14px;
7
11
  margin-bottom: $baseLineHeight;
8
12
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
9
13
  background-color: $warningBackground;
10
14
  border: 1px solid $warningBorder;
11
- @include bootstrap-border-radius(4px);
15
+ @include ctb-border-radius($baseBorderRadius);
16
+ }
17
+ .alert,
18
+ .alert h4 {
19
+ // Specified for the h4 to prevent conflicts of changing $headingsColor
12
20
  color: $warningText;
13
21
  }
14
- .alert-heading {
15
- color: inherit;
22
+ .alert h4 {
23
+ margin: 0;
16
24
  }
17
25
 
18
26
  // Adjust close link position
@@ -20,15 +28,19 @@
20
28
  position: relative;
21
29
  top: -2px;
22
30
  right: -21px;
23
- line-height: 18px;
31
+ line-height: $baseLineHeight;
24
32
  }
25
33
 
34
+
26
35
  // Alternate styles
27
- // ----------------
36
+ // -------------------------
28
37
 
29
38
  .alert-success {
30
39
  background-color: $successBackground;
31
- border-color: $successBorder;
40
+ border-color: $successBorder;
41
+ color: $successText;
42
+ }
43
+ .alert-success h4 {
32
44
  color: $successText;
33
45
  }
34
46
  .alert-danger,
@@ -37,14 +49,23 @@
37
49
  border-color: $errorBorder;
38
50
  color: $errorText;
39
51
  }
52
+ .alert-danger h4,
53
+ .alert-error h4 {
54
+ color: $errorText;
55
+ }
40
56
  .alert-info {
41
57
  background-color: $infoBackground;
42
58
  border-color: $infoBorder;
43
59
  color: $infoText;
44
60
  }
61
+ .alert-info h4 {
62
+ color: $infoText;
63
+ }
64
+
45
65
 
46
66
  // Block alerts
47
- // ------------------------
67
+ // -------------------------
68
+
48
69
  .alert-block {
49
70
  padding-top: 14px;
50
71
  padding-bottom: 14px;
@@ -1,24 +1,24 @@
1
- // BREADCRUMBS
2
- // -----------
1
+ //
2
+ // Breadcrumbs
3
+ // --------------------------------------------------
4
+
3
5
 
4
6
  .breadcrumb {
5
- padding: 7px 14px;
7
+ padding: 8px 15px;
6
8
  margin: 0 0 $baseLineHeight;
7
9
  list-style: none;
8
- @include bootstrap-gradient-vertical($white, #f5f5f5);
9
- border: 1px solid #ddd;
10
- @include bootstrap-border-radius(3px);
11
- @include bootstrap-box-shadow(inset 0 1px 0 $white);
12
- li {
10
+ background-color: #f5f5f5;
11
+ @include ctb-border-radius($baseBorderRadius);
12
+ > li {
13
13
  display: inline-block;
14
- @include bootstrap-ie7-inline-block();
14
+ @include ctb-ie7-inline-block();
15
15
  text-shadow: 0 1px 0 $white;
16
+ > .divider {
17
+ padding: 0 5px;
18
+ color: #ccc;
19
+ }
16
20
  }
17
- .divider {
18
- padding: 0 5px;
21
+ > .active {
19
22
  color: $grayLight;
20
23
  }
21
- .active a {
22
- color: $grayDark;
23
- }
24
24
  }
@@ -1,12 +1,17 @@
1
- // BUTTON GROUPS
2
- // -------------
1
+ //
2
+ // Button groups
3
+ // --------------------------------------------------
3
4
 
4
5
 
5
6
  // Make the div behave like a button
6
7
  .btn-group {
7
8
  position: relative;
8
- @include bootstrap-clearfix(); // clears the floated buttons
9
- @include bootstrap-ie7-restore-left-whitespace();
9
+ display: inline-block;
10
+ @include ctb-ie7-inline-block();
11
+ font-size: 0; // remove as part 1 of font-size inline-block hack
12
+ vertical-align: middle; // match .btn alignment given font-size hack above
13
+ white-space: nowrap; // prevent buttons from wrapping when in tight spaces (e.g., the table on the tests page)
14
+ @include ctb-ie7-restore-left-whitespace();
10
15
  }
11
16
 
12
17
  // Space out series of button groups
@@ -16,59 +21,63 @@
16
21
 
17
22
  // Optional: Group multiple button groups together for a toolbar
18
23
  .btn-toolbar {
24
+ font-size: 0; // Hack to remove whitespace that results from using inline-block
19
25
  margin-top: $baseLineHeight / 2;
20
26
  margin-bottom: $baseLineHeight / 2;
21
- .btn-group {
22
- display: inline-block;
23
- @include bootstrap-ie7-inline-block();
27
+ > .btn + .btn,
28
+ > .btn-group + .btn,
29
+ > .btn + .btn-group {
30
+ margin-left: 5px;
24
31
  }
25
32
  }
26
33
 
27
34
  // Float them, remove border radius, then re-add to first and last elements
28
35
  .btn-group > .btn {
29
36
  position: relative;
30
- float: left;
37
+ @include ctb-border-radius(0);
38
+ }
39
+ .btn-group > .btn + .btn {
31
40
  margin-left: -1px;
32
- @include bootstrap-border-radius(0);
33
41
  }
42
+ .btn-group > .btn,
43
+ .btn-group > .dropdown-menu,
44
+ .btn-group > .popover {
45
+ font-size: $baseFontSize; // redeclare as part 2 of font-size inline-block hack
46
+ }
47
+
48
+ // Reset fonts for other sizes
49
+ .btn-group > .btn-mini {
50
+ font-size: $fontSizeMini;
51
+ }
52
+ .btn-group > .btn-small {
53
+ font-size: $fontSizeSmall;
54
+ }
55
+ .btn-group > .btn-large {
56
+ font-size: $fontSizeLarge;
57
+ }
58
+
34
59
  // Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match
35
60
  .btn-group > .btn:first-child {
36
61
  margin-left: 0;
37
- -webkit-border-top-left-radius: 4px;
38
- -moz-border-radius-topleft: 4px;
39
- border-top-left-radius: 4px;
40
- -webkit-border-bottom-left-radius: 4px;
41
- -moz-border-radius-bottomleft: 4px;
42
- border-bottom-left-radius: 4px;
62
+ @include ctb-border-top-left-radius($baseBorderRadius);
63
+ @include ctb-border-bottom-left-radius($baseBorderRadius);
43
64
  }
44
65
  // Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it
45
66
  .btn-group > .btn:last-child,
46
67
  .btn-group > .dropdown-toggle {
47
- -webkit-border-top-right-radius: 4px;
48
- -moz-border-radius-topright: 4px;
49
- border-top-right-radius: 4px;
50
- -webkit-border-bottom-right-radius: 4px;
51
- -moz-border-radius-bottomright: 4px;
52
- border-bottom-right-radius: 4px;
68
+ @include ctb-border-top-right-radius($baseBorderRadius);
69
+ @include ctb-border-bottom-right-radius($baseBorderRadius);
53
70
  }
54
71
  // Reset corners for large buttons
55
72
  .btn-group > .btn.large:first-child {
56
73
  margin-left: 0;
57
- -webkit-border-top-left-radius: 6px;
58
- -moz-border-radius-topleft: 6px;
59
- border-top-left-radius: 6px;
60
- -webkit-border-bottom-left-radius: 6px;
61
- -moz-border-radius-bottomleft: 6px;
62
- border-bottom-left-radius: 6px;
74
+ @include ctb-border-top-left-radius($borderRadiusLarge);
75
+ @include ctb-border-bottom-left-radius($borderRadiusLarge);
63
76
  }
64
77
  .btn-group > .btn.large:last-child,
65
78
  .btn-group > .large.dropdown-toggle {
66
- -webkit-border-top-right-radius: 6px;
67
- -moz-border-radius-topright: 6px;
68
- border-top-right-radius: 6px;
69
- -webkit-border-bottom-right-radius: 6px;
70
- -moz-border-radius-bottomright: 6px;
71
- border-bottom-right-radius: 6px;
79
+ @include ctb-border-top-right-radius($borderRadiusLarge);
80
+ @include ctb-border-bottom-right-radius($borderRadiusLarge);
72
81
  }
73
82
 
74
83
  // On hover/focus/active, bring the proper btn to front
@@ -91,24 +100,28 @@
91
100
  // ----------------------
92
101
 
93
102
  // Give the line between buttons some depth
94
- .btn-group > .dropdown-toggle {
103
+ .btn-group > .btn + .dropdown-toggle {
95
104
  padding-left: 8px;
96
105
  padding-right: 8px;
97
- @include bootstrap-box-shadow("inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)");
98
- *padding-top: 4px;
99
- *padding-bottom: 4px;
106
+ @include ctb-box-shadow(#{inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)});
107
+ *padding-top: 5px;
108
+ *padding-bottom: 5px;
100
109
  }
101
- .btn-group > .btn-mini.dropdown-toggle {
110
+ .btn-group > .btn-mini + .dropdown-toggle {
102
111
  padding-left: 5px;
103
112
  padding-right: 5px;
113
+ *padding-top: 2px;
114
+ *padding-bottom: 2px;
104
115
  }
105
- .btn-group > .btn-small.dropdown-toggle {
106
- *padding-top: 4px;
116
+ .btn-group > .btn-small + .dropdown-toggle {
117
+ *padding-top: 5px;
107
118
  *padding-bottom: 4px;
108
119
  }
109
- .btn-group > .btn-large.dropdown-toggle {
120
+ .btn-group > .btn-large + .dropdown-toggle {
110
121
  padding-left: 12px;
111
122
  padding-right: 12px;
123
+ *padding-top: 7px;
124
+ *padding-bottom: 7px;
112
125
  }
113
126
 
114
127
  .btn-group.open {
@@ -117,7 +130,7 @@
117
130
  // Remove the gradient and set the same inset shadow as the :active state
118
131
  .dropdown-toggle {
119
132
  background-image: none;
120
- @include bootstrap-box-shadow("inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)");
133
+ @include ctb-box-shadow(#{inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)});
121
134
  }
122
135
 
123
136
  // Keep the hover's background when dropdown is open
@@ -147,30 +160,23 @@
147
160
 
148
161
  // Reposition the caret
149
162
  .btn .caret {
150
- margin-top: 7px;
163
+ margin-top: 8px;
151
164
  margin-left: 0;
152
165
  }
153
- .btn:hover .caret,
154
- .open.btn-group .caret {
155
- @include bootstrap-opacity(100);
156
- }
157
166
  // Carets in other button sizes
158
- .btn-mini .caret {
159
- margin-top: 5px;
160
- }
161
- .btn-small .caret {
167
+ .btn-mini .caret,
168
+ .btn-small .caret,
169
+ .btn-large .caret {
162
170
  margin-top: 6px;
163
171
  }
164
172
  .btn-large .caret {
165
- margin-top: 6px;
166
173
  border-left-width: 5px;
167
174
  border-right-width: 5px;
168
175
  border-top-width: 5px;
169
176
  }
170
177
  // Upside down carets for .dropup
171
178
  .dropup .btn-large .caret {
172
- border-bottom: 5px solid $black;
173
- border-top: 0;
179
+ border-bottom-width: 5px;
174
180
  }
175
181
 
176
182
 
@@ -185,7 +191,37 @@
185
191
  .caret {
186
192
  border-top-color: $white;
187
193
  border-bottom-color: $white;
188
- @include bootstrap-opacity(75);
189
194
  }
190
195
  }
191
196
 
197
+
198
+
199
+ // Vertical button groups
200
+ // ----------------------
201
+
202
+ .btn-group-vertical {
203
+ display: inline-block; // makes buttons only take up the width they need
204
+ @include ctb-ie7-inline-block();
205
+ }
206
+ .btn-group-vertical > .btn {
207
+ display: block;
208
+ float: none;
209
+ max-width: 100%;
210
+ @include ctb-border-radius(0);
211
+ }
212
+ .btn-group-vertical > .btn + .btn {
213
+ margin-left: 0;
214
+ margin-top: -1px;
215
+ }
216
+ .btn-group-vertical > .btn:first-child {
217
+ @include ctb-border-radius($baseBorderRadius $baseBorderRadius 0 0);
218
+ }
219
+ .btn-group-vertical > .btn:last-child {
220
+ @include ctb-border-radius(0 0 $baseBorderRadius $baseBorderRadius);
221
+ }
222
+ .btn-group-vertical > .btn-large:first-child {
223
+ @include ctb-border-radius($borderRadiusLarge $borderRadiusLarge 0 0);
224
+ }
225
+ .btn-group-vertical > .btn-large:last-child {
226
+ @include ctb-border-radius(0 0 $borderRadiusLarge $borderRadiusLarge);
227
+ }