Skip to content

Commit

Permalink
update compass extensions:
Browse files Browse the repository at this point in the history
* bootstrap-sass 3.2.0.1
* susy-2.1.2

add compass extensions:

* breakpoint and sass-maps (required by susy)
  • Loading branch information
hlb committed Sep 4, 2014
1 parent 6ad99a4 commit 34c3dc1
Show file tree
Hide file tree
Showing 268 changed files with 1,563 additions and 68 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- Compass generator now copies JS and fonts, and provides a better default `styles.sass`.
- Compass, Sprockets, and Mincer asset path helpers are now provided in pure Sass: `bootstrap-compass`, `bootstrap-sprockets`, and `bootstrap-mincer`.
Asset path helpers must be imported before `bootstrap`, more in Readme.
- Sprockets / Mincer JS manifest has been moved to `bootstrap-mincer.js`.
- Sprockets / Mincer JS manifest has been moved to `bootstrap-sprockets.js`.
It can be required without adding Bootstrap JS directory to load path, as it now uses relative paths.
- Sprockets: `depend_on_asset` (`glyphicons.scss`) has been changed to `depend_on` to work around an issue with `depend_on_asset`.
[More information](https://github.com/twbs/bootstrap-sass/issues/592#issuecomment-46570286).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ gem 'autoprefixer-rails'

`bundle install` and restart your server to make the files available through the pipeline.

In `app/assets/application.css.sass`:
In `app/assets/stylesheets/application.css.scss`:

```sass
@import "bootstrap-sprockets"
@import "bootstrap"
```scss
@import "bootstrap-sprockets";
@import "bootstrap";
```

Do not use `//= require` in Sass or your other stylesheets will not be [able to access][antirequire] the Bootstrap mixins or variables.

In `app/assets/application.js`:
In `app/assets/javascripts/application.js`:

```js
//= require jquery
Expand Down Expand Up @@ -141,8 +141,8 @@ You can also import components explicitly. To start with a full list of modules
Then comment out components you do not want from `bootstrap-custom`.
In the application Sass file, replace `@import 'bootstrap'` with:

```sass
@import 'bootstrap-custom'
```scss
@import 'bootstrap-custom';
```

#### Sass: Number Precision
Expand Down Expand Up @@ -192,17 +192,17 @@ You can check dependencies in the [Bootstrap JS documentation][jsdocs].

The fonts are referenced as:

```sass
```scss
"#{$icon-font-path}#{$icon-font-name}.eot"
```

`$icon-font-path` defaults to `bootstrap/`.
`$icon-font-path` defaults to `bootstrap/` if asset path helpers are used, and `../fonts/bootstrap/` otherwise.

When using with Compass, Sprockets, or Mincer, make sure to import the relevant path helpers before Bootstrap itself, for example:.
When using bootstrap-sass with Compass, Sprockets, or Mincer, you **must** import the relevant path helpers before Bootstrap itself, for example:

```sass
@import bootstrap-compass
@import bootstrap
```scss
@import "bootstrap-compass";
@import "bootstrap";
```

## Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ a.list-group-item {
&.disabled:focus {
background-color: $list-group-disabled-bg;
color: $list-group-disabled-color;

cursor: not-allowed;

// Force color to inherit for custom content
.list-group-item-heading {
color: inherit;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// a flag to toggle asset pipeline / compass integration
// defaults to true if twbs-font-path function is present (no function => twbs-font-path('') parsed as string == right side)
// in Sass 3.3 this can be improved with: function-exists(twbs-font-path)
// When true, asset path helpers are used, otherwise regular url() is used
// When there no function is defined, `fn('')` is parsed as string that equals the right hand side
// NB: in Sass 3.3 there is a native function: function-exists(twbs-font-path)
$bootstrap-sass-asset-helper: (twbs-font-path("") != unquote('twbs-font-path("")')) !default;

//
// Variables
// --------------------------------------------------
Expand Down Expand Up @@ -77,7 +78,10 @@ $headings-color: inherit !default;
//## Specify custom location and filename of the included Glyphicons icon font. Useful for those including Bootstrap via Bower.

//** Load fonts from this directory.
$icon-font-path: "bootstrap/" !default;

// [converter] Asset helpers such as Sprockets and Node.js Mincer do not resolve relative paths
$icon-font-path: if($bootstrap-sass-asset-helper, "bootstrap/", "../fonts/bootstrap/") !default;

//** File name for all font files.
$icon-font-name: "glyphicons-halflings-regular" !default;
//** Element ID within SVG icon file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def rails?
private

def configure_sass
require 'sass' unless defined?(::Sass)
require 'sass'

::Sass.load_paths << stylesheets_path

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Bootstrap
VERSION = '3.2.0.1'
BOOTSTRAP_SHA = '1098453f831fad3fdfcbf036237ed064a5d29b26'
end
5 changes: 5 additions & 0 deletions lib/ruby/compass_extensions/bootstrap-sass-3.2.0.1/sache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "bootstrap-sass",
"description": "bootstrap-sass is a Sass-powered version of Bootstrap, ready to drop right into your Sass powered applications",
"tags": ["bootstrap", "grid", "typography", "buttons", "ui", "responsive-web-design"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,16 @@ def process_stylesheet_assets
file = apply_mixin_parent_selector file, '\.(?:visible|hidden)'
when 'variables.less'
file = insert_default_vars(file)
file = unindent <<-SCSS + file, 14
// a flag to toggle asset pipeline / compass integration
// defaults to true if twbs-font-path function is present (no function => twbs-font-path('') parsed as string == right side)
// in Sass 3.3 this can be improved with: function-exists(twbs-font-path)
$bootstrap-sass-asset-helper: (twbs-font-path("") != unquote('twbs-font-path("")')) !default;
file = unindent <<-SCSS + "\n" + file, 14
// When true, asset path helpers are used, otherwise regular `url()`` is used.
// When there no function is defined, `fn('')` is parsed as string that equals the right hand side
// NB: in Sass 3.3 there is a native function: function-exists(twbs-font-path)
$bootstrap-sass-asset-helper: #{sass_fn_exists('twbs-font-path')} !default;
SCSS
file = replace_all file, %r{(\$icon-font-path): \s*"(.*)" (!default);}, "\n" + unindent(<<-SCSS, 14)
// [converter] Asset helpers such as Sprockets and Node.js Mincer do not resolve relative paths
\\1: if($bootstrap-sass-asset-helper, "bootstrap/", "\\2bootstrap/") \\3;
SCSS
file = replace_all file, /(\$icon-font-path:).*(!default)/, '\1 "bootstrap/" \2'
when 'close.less'
# extract .close { button& {...} } rule
file = extract_nested_rule file, 'button&'
Expand Down Expand Up @@ -160,6 +163,10 @@ def convert_to_scss(file)
file
end

def sass_fn_exists(fn)
%Q{(#{fn}("") != unquote('#{fn}("")'))}
end

def replace_asset_url(rule, type)
replace_all rule, /url\((.*?)\)/, "url(if($bootstrap-sass-asset-helper, twbs-#{type}-path(\\1), \\1))"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def log_http_get_file(url, cached = false)
end

def log_http_get_files(files, from, cached = false)
return if files.empty?
s = " #{'CACHED ' if cached}GET #{files.length} files from #{from} #{files * ' '}..."
if cached
puts dark green s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def read_files(path, files)
log_http_get_files files, full_path, false
files.map do |name|
Thread.start {
content = open("#{full_path}/#{name}").read
Thread.exclusive { write_cached_files path, name => content }
contents[name] = open("#{full_path}/#{name}").read
Thread.exclusive { write_cached_files path, name => contents[name] }
}
end.each(&:join)
contents
Expand All @@ -29,8 +29,8 @@ def read_cached_files(path, files)
path = "#{full_path}/#{name}"
contents[name] = File.read(path, mode: 'rb') if File.exists?(path)
end
contents
end
contents
end

def write_cached_files(path, files)
Expand Down
56 changes: 56 additions & 0 deletions lib/ruby/compass_extensions/breakpoint-2.5.0/CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Changelog

## 2.2.0 - Nov 23, 2013
* fix simple or queries
* convert respond-to to use sass maps
* convert context to use sass maps

## 2.0.7 - Sept 17th, 2013
* fix fallback support for 1.x

## 2.0.0 - The Past
* Looks like we forgot relase notes for 2.0. oops

## 1.3 - August 28th, 2012
* better conversion to base-ems
* fix floating point error

## 1.2 - August 16th, 2012
* Added ability to force the 'all' media type to be written by setting `$breakpoint-force-media-all: true;`. Defaults to `false`.
* Added ability to generate no query fallback code. See the README for full documentaiton.

## 1.1.1 - July 30, 2012
* Added (forgot to include the first time) the ability to query the media type using `breakpoint-get-context('media')`


## 1.1 - July 29, 2012
* Added function `breakpoint-get-context($feature)` to allow users to get the current media query context

## 1.0.2 - July 28, 2012
* Refixed our 'device-pixel-ratio' conversions because, frankly, the w3c was wrong.
* fixed bugs that caused single and triple value single queries to fail. Also bugs with stacking single and triple value queries.

## 1.0.1 - June 27, 2012
* fixed logic error that would print multiple instences of a media type

## 1.0 - June 22, 2012
* Refactor of the underlying logic to make everything work better and make the world a happy place.
* Added default options for Default Feature, Default Media, and Default Feature Pair.
* Changed default media from "Screen" to "All".
* Added ability to have all px/pt/percentage media queries transformed into em based media queries.

## 0.3 - June 18, 2012
* Rewrote 'device-pixel-ratio' conversions to change from prefixed nightmarish hell to Resolution standard based on the [W3C Unprefixing -webkit-device-pixel-ratio article](http://www.w3.org/blog/CSS/2012/06/14/unprefix-webkit-device-pixel-ratio/)
* Large README update covering feature set, installation, assumptions, and more.

## 0.2 - May 24, 2012
* Converted from Sass to SCSS
* Converted README examples from Sass to SCSS
* Added ability to do min/max easily with any valid feature
* Added prefixing for "device-pixel-ratio" feature for the three implementations (-webkit, -moz, -o) as well as a standard version for future friendliness
* -moz's min/max is different than -webkit or -o, so prefixed differently
* Opera is strange and needs its DPR in a ratio instead of a floating point number, so requires the fraction rubygem and has a numerator/denominator function to accommodate.
* Added ability to have single feature/value input be either have feature first or second

## 0.1 - May 22, 2012
* extract breakpoint from survival kit to this gem
41 changes: 41 additions & 0 deletions lib/ruby/compass_extensions/breakpoint-2.5.0/README.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Breakpoint [![Gem Version](https://badge.fury.io/rb/breakpoint.png)](http://badge.fury.io/rb/breakpoint) [![Build Status](https://travis-ci.org/Team-Sass/breakpoint.png)](https://travis-ci.org/Team-Sass/breakpoint)

**Really Simple Media Queries with Sass**

Breakpoint makes writing media queries in Sass super simple. Create a variable using a simplified syntax based on most commonly used media queries, then call it using the `breakpoint` mixin. Breakpoint handles all of the heavy lifting, from writing the media query itself, to handling cross-browser compatibility issues, so you can focus on what's important: making sure your website looks its best.

Breakpoint also allows you to get the [context of your media queries](https://github.com/Team-Sass/breakpoint/wiki/Breakpoint-Context) from your code, allowing you to write dynamic mixins based on their media query context.

If you'd prefer the semantic awesomeness of string names to identify your queries as opposed to variables, or want to dynamically generate media queries, the [Respond-To](https://github.com/Team-Sass/breakpoint/wiki/Respond-To) syntax is now included in Breakpoint core!

**It is important to note** that due to limitations within the Sass language itself, which themselves stem from some potentially unexpected cascading from doing so, Breakpoint is unable to concat like media queries into a single media query. This means they will be spread out throughout your CSS. This is unfortunate, yes, but currently unavoidable. That being said, once [Sass Issue #241: Seperate Media/Browser Specific Markup to Separate Style Sheet](https://github.com/nex3/sass/issues/241) hits, be sure we're going to take full advantage of it.


## Full documentation is available on the [Breakpoint Wiki](https://github.com/Team-Sass/breakpoint/wiki)

## Getting Help with Breakpoint

* For help with Breakpoint, please ask a question on [Stack Overflow](http://stackoverflow.com/questions/ask) tagged with "breakpoint-sass".
* To file an issue with Breakpoint, be it a feature request or a bug report, please use our [Issue Queue](https://github.com/Team-Sass/breakpoint/issues).
* If you are in IRC, the maintainers and many fellow users tend to hang out in the #sass and #compass rooms on irc.freenode.net. Asking in there may get you a quick answer to your question, but we still encourage you to file your inquiry in the appropriate place above to

## Contributing to Breakpoint

We love contributors! Yes we do! If you would like to contribute to Breakpoint, please follow the [Contributing Guidelines](https://github.com/Team-Sass/breakpoint/blob/2.x.x/CONTRIBUTING.md)

## Awesome Things Built With Breakpoint

Breakpoint is designed to be a Media Query engine to power everything from design tweaks to media query contexts to full media query fallbacks. But we also know that our users will build awesome thing with these tools. Build a Breakpoint powered mixin for new media query semantics? We want to hear about it! Build something cool with Context? Let us know! If you would like to add your Awesome Thing to the list, please issue a Pull Request to add it!

* [Singularity](https://github.com/Team-Sass/Singularity) - Semantic Grid System
* [Breakpoint Slicer](https://github.com/lolmaus/breakpoint-slicer) - Quick and efficient syntax for Min/Max Width media queries

## License

Licensed under MIT/GPL.

GPL2 license:
http://www.gnu.org/licenses/gpl-2.0.html

MIT license:
http://www.opensource.org/licenses/mit-license.php
17 changes: 17 additions & 0 deletions lib/ruby/compass_extensions/breakpoint-2.5.0/lib/breakpoint.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
base_directory = File.expand_path(File.join(File.dirname(__FILE__), '..'))
breakpoint_stylesheets_path = File.join(base_directory, 'stylesheets')

if (defined? Compass)
require 'sassy-maps'
Compass::Frameworks.register(
"breakpoint",
:path => base_directory
)
else
ENV["SASS_PATH"] = [ENV["SASS_PATH"], breakpoint_stylesheets_path].compact.join(File::PATH_SEPARATOR)
end

module Breakpoint
VERSION = "2.5.0"
DATE = "2014-08-05"
end
Loading

0 comments on commit 34c3dc1

Please sign in to comment.