Skip to content

Commit

Permalink
rake convert
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm committed Dec 3, 2013
1 parent 8b9e775 commit cc2ec7e
Show file tree
Hide file tree
Showing 33 changed files with 218 additions and 272 deletions.
2 changes: 1 addition & 1 deletion lib/bootstrap-sass/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Bootstrap
VERSION = '3.0.2.1'
BOOTSTRAP_SHA = '6ed5a844a8ca3582240ddda70d63a3d7bfea7c50'
BOOTSTRAP_SHA = 'cc6951fa15ab990b5d90edd7acc9f1bbf2f16875'
end
7 changes: 4 additions & 3 deletions tasks/converter/less_conversion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def process_stylesheet_assets
when 'thumbnails.less'
file = extract_nested_rule file, 'a&'
when 'glyphicons.less'
file = replace_all file, /\#\{(url\(.*?\))}/, '\1'
file = replace_rules(file, '@font-face') { |rule|
rule = replace_all rule, /(\$icon-font-\w+)/, '#{\1}'
replace_asset_url rule, :font
Expand Down Expand Up @@ -404,7 +405,7 @@ def replace_image_urls(less)
end

def replace_escaping(less)
less = less.gsub(/\~"([^"]+)"/, '#{\1}') # Get rid of ~"" escape
less = less.gsub(/~"([^"]+)"/, '#{\1}') # Get rid of ~"" escape
less.gsub!(/\$\{([^}]+)\}/, '$\1') # Get rid of @{} escape
less.gsub!(/"([^"\n]*)(\$[\w\-]+)([^"\n]*)"/, '"\1#{\2}\3"') # interpolate variable in string, e.g. url("$file-1x") => url("#{$file-1x}")
less.gsub(/(\W)e\(%\("?([^"]*)"?\)\)/, '\1\2') # Get rid of e(%("")) escape
Expand All @@ -420,7 +421,7 @@ def convert_less_ampersand(less)
regx = /^\.badge\s*\{[\s\/\w\(\)]+(&{1}-{1})\w.*?^}$/m

tmp = ''
less.scan(/^(\s*&)(-[\w\[\]]+\s*{.+})$/) do |ampersand, css|
less.scan(/^(\s*&)(-[\w\[\]]+\s*\{.+})$/) do |ampersand, css|
tmp << ".badge#{css}\n"
end

Expand Down Expand Up @@ -609,4 +610,4 @@ def replace_substrings_at(text, positions, replacements = nil, &block)
text
end
end
end
end
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap/affix.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: affix.js v3.0.2
* Bootstrap: affix.js v3.0.3
* http://getbootstrap.com/javascript/#affix
* ========================================================================
* Copyright 2013 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap/alert.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: alert.js v3.0.2
* Bootstrap: alert.js v3.0.3
* http://getbootstrap.com/javascript/#alerts
* ========================================================================
* Copyright 2013 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap/button.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: button.js v3.0.2
* Bootstrap: button.js v3.0.3
* http://getbootstrap.com/javascript/#buttons
* ========================================================================
* Copyright 2013 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap/carousel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: carousel.js v3.0.2
* Bootstrap: carousel.js v3.0.3
* http://getbootstrap.com/javascript/#carousel
* ========================================================================
* Copyright 2013 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap/collapse.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: collapse.js v3.0.2
* Bootstrap: collapse.js v3.0.3
* http://getbootstrap.com/javascript/#collapse
* ========================================================================
* Copyright 2013 Twitter, Inc.
Expand Down
6 changes: 3 additions & 3 deletions vendor/assets/javascripts/bootstrap/dropdown.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: dropdown.js v3.0.2
* Bootstrap: dropdown.js v3.0.3
* http://getbootstrap.com/javascript/#dropdowns
* ========================================================================
* Copyright 2013 Twitter, Inc.
Expand Down Expand Up @@ -123,9 +123,9 @@
$.fn.dropdown = function (option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('dropdown')
var data = $this.data('bs.dropdown')

if (!data) $this.data('dropdown', (data = new Dropdown(this)))
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
if (typeof option == 'string') data[option].call($this)
})
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap/modal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: modal.js v3.0.2
* Bootstrap: modal.js v3.0.3
* http://getbootstrap.com/javascript/#modals
* ========================================================================
* Copyright 2013 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap/popover.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: popover.js v3.0.2
* Bootstrap: popover.js v3.0.3
* http://getbootstrap.com/javascript/#popovers
* ========================================================================
* Copyright 2013 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap/scrollspy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: scrollspy.js v3.0.2
* Bootstrap: scrollspy.js v3.0.3
* http://getbootstrap.com/javascript/#scrollspy
* ========================================================================
* Copyright 2013 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap/tab.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: tab.js v3.0.2
* Bootstrap: tab.js v3.0.3
* http://getbootstrap.com/javascript/#tabs
* ========================================================================
* Copyright 2013 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap/tooltip.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: tooltip.js v3.0.2
* Bootstrap: tooltip.js v3.0.3
* http://getbootstrap.com/javascript/#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap/transition.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================================
* Bootstrap: transition.js v3.0.2
* Bootstrap: transition.js v3.0.3
* http://getbootstrap.com/javascript/#transitions
* ========================================================================
* Copyright 2013 Twitter, Inc.
Expand Down
12 changes: 6 additions & 6 deletions vendor/assets/stylesheets/bootstrap/_badges.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
&:empty {
display: none;
}

// Quick fix for badges in buttons
.btn & {
position: relative;
top: -1px;
}
}

// Hover state, but only for links
Expand All @@ -34,12 +40,6 @@ a.badge {
}
}

// Quick fix for labels/badges in buttons
.btn .badge {
position: relative;
top: -1px;
}

// Account for counters in navs
a.list-group-item.active > .badge,
.nav-pills > .active > a > .badge {
Expand Down
40 changes: 7 additions & 33 deletions vendor/assets/stylesheets/bootstrap/_button-groups.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,6 @@
// Button groups
// --------------------------------------------------

// Button carets
//
// Match the button text color to the arrow/caret for indicating dropdown-ness.

.caret {
.btn-default & {
border-top-color: $btn-default-color;
}
.btn-primary &,
.btn-success &,
.btn-warning &,
.btn-danger &,
.btn-info & {
border-top-color: #fff;
}
}
.dropup {
.btn-default .caret {
border-bottom-color: $btn-default-color;
}
.btn-primary,
.btn-success,
.btn-warning,
.btn-danger,
.btn-info {
.caret {
border-bottom-color: #fff;
}
}
}

// Make the div behave like a button
.btn-group,
.btn-group-vertical {
Expand Down Expand Up @@ -178,7 +147,8 @@

.btn-group-vertical {
> .btn,
> .btn-group {
> .btn-group,
> .btn-group > .btn {
display: block;
float: none;
width: 100%;
Expand Down Expand Up @@ -238,11 +208,15 @@
width: 100%;
table-layout: fixed;
border-collapse: separate;
.btn {
> .btn,
> .btn-group {
float: none;
display: table-cell;
width: 1%;
}
> .btn-group .btn {
width: 100%;
}
}


Expand Down
1 change: 1 addition & 0 deletions vendor/assets/stylesheets/bootstrap/_carousel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
// Hover/focus state
&:hover,
&:focus {
outline: none;
color: $carousel-control-color;
text-decoration: none;
@include opacity(.9);
Expand Down
4 changes: 2 additions & 2 deletions vendor/assets/stylesheets/bootstrap/_dropdowns.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
height: 0;
margin-left: 2px;
vertical-align: middle;
border-top: $caret-width-base solid $dropdown-caret-color;
border-top: $caret-width-base solid;
border-right: $caret-width-base solid transparent;
border-left: $caret-width-base solid transparent;
}
Expand Down Expand Up @@ -161,7 +161,7 @@
// Reverse the caret
.caret {
border-top: 0;
border-bottom: $caret-width-base solid $dropdown-caret-color;
border-bottom: $caret-width-base solid;
content: "";
}
// Different positioning for bottom up menu
Expand Down
11 changes: 11 additions & 0 deletions vendor/assets/stylesheets/bootstrap/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ input[type="checkbox"],
display: inline-block;
}

// Override `width: 100%;` when not within a `.form-group`
select.form-control {
width: auto;
}

// Remove default margin on radios/checkboxes that were used for stacking, and
// then undo the floating of radios and checkboxes to match (which also avoids
// a bug in WebKit: https://github.com/twbs/bootstrap/issues/1969).
Expand Down Expand Up @@ -344,6 +349,12 @@ input[type="checkbox"],
margin-bottom: 0;
padding-top: ($padding-base-vertical + 1); // Default padding plus a border
}
// Account for padding we're adding to ensure the alignment and of help text
// and other content below items
.radio,
.checkbox {
min-height: $line-height-computed + ($padding-base-vertical + 1);
}

// Make form groups behave like rows
.form-group {
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/stylesheets/bootstrap/_glyphicons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
src: url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.eot?#iefix'), '#{$icon-font-path}#{$icon-font-name}.eot?#iefix')) format('embedded-opentype'),
url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.woff'), '#{$icon-font-path}#{$icon-font-name}.woff')) format('woff'),
url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.ttf'), '#{$icon-font-path}#{$icon-font-name}.ttf')) format('truetype'),
url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.svg#glyphicons_halflingsregular'), '#{$icon-font-path}#{$icon-font-name}.svg#glyphicons_halflingsregular')) format('svg');
url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.svg#glyphicons-halflingsregular'), '#{$icon-font-path}#{$icon-font-name}.svg#glyphicons-halflingsregular')) format('svg');
}

// Catchall baseclass
Expand Down
38 changes: 12 additions & 26 deletions vendor/assets/stylesheets/bootstrap/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
// Set the container width, and override it for fixed navbars in media queries
.container {
@include container-fixed();

@media (min-width: $screen-sm) {
width: $container-sm;
}
@media (min-width: $screen-md) {
width: $container-md;
}
@media (min-width: $screen-lg-min) {
width: $container-lg;
}
}

// mobile first defaults
Expand All @@ -18,11 +28,8 @@

// Extra small grid
//
// Grid classes for extra small devices like smartphones. No offset, push, or
// pull classes are present here due to the size of the target.
//
// Note that `.col-xs-12` doesn't get floated on purpose--there's no need since
// it's full-width.
// Columns, offsets, pushes, and pulls for extra small devices like
// smartphones.

@include make-grid-columns-float(xs);
@include make-grid($grid-columns, xs, width);
Expand All @@ -35,15 +42,8 @@
//
// Columns, offsets, pushes, and pulls for the small device range, from phones
// to tablets.
//
// Note that `.col-sm-12` doesn't get floated on purpose--there's no need since
// it's full-width.

@media (min-width: $screen-sm-min) {
.container {
width: $container-sm;
}

@include make-grid-columns-float(sm);
@include make-grid($grid-columns, sm, width);
@include make-grid($grid-columns, sm, pull);
Expand All @@ -55,15 +55,8 @@
// Medium grid
//
// Columns, offsets, pushes, and pulls for the desktop device range.
//
// Note that `.col-md-12` doesn't get floated on purpose--there's no need since
// it's full-width.

@media (min-width: $screen-md-min) {
.container {
width: $container-md;
}

@include make-grid-columns-float(md);
@include make-grid($grid-columns, md, width);
@include make-grid($grid-columns, md, pull);
Expand All @@ -75,15 +68,8 @@
// Large grid
//
// Columns, offsets, pushes, and pulls for the large desktop device range.
//
// Note that `.col-lg-12` doesn't get floated on purpose--there's no need since
// it's full-width.

@media (min-width: $screen-lg-min) {
.container {
width: $container-lg;
}

@include make-grid-columns-float(lg);
@include make-grid($grid-columns, lg, width);
@include make-grid($grid-columns, lg, pull);
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/stylesheets/bootstrap/_input-groups.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table

// Undo padding and float of grid classes
&.col {
&[class*="col-"] {
float: none;
padding-left: 0;
padding-right: 0;
Expand Down
Loading

0 comments on commit cc2ec7e

Please sign in to comment.