Permalink
Browse files

Remove Bourbon as a dependency

(feelsbadman) but the dependency on Bourbon was technically minimal. By
removing the dependency on Bourbon we are able to gain more users and
can potentially grow the community.

resolves #346
  • Loading branch information...
1 parent 4bef318 commit 441549048f59b2cc8264e4a5a4496f9e934d69ef @meowsus meowsus committed May 28, 2016
View
@@ -1,5 +1,4 @@
-var bourbon = require("bourbon").includePaths,
- autoprefix = require("gulp-autoprefixer"),
+var autoprefix = require("gulp-autoprefixer"),
connect = require("gulp-connect"),
gulp = require("gulp"),
sass = require("gulp-sass");
@@ -13,7 +12,7 @@ var paths = {
gulp.task("sass", function () {
return gulp.src(paths.scss)
.pipe(sass({
- includePaths: ["styles"].concat(bourbon)
+ sourcemaps: true
}))
.pipe(autoprefix("last 2 versions"))
.pipe(gulp.dest("./contrib"))
View
@@ -4,9 +4,9 @@
[![Gitter](http://img.shields.io/badge/gitter-neat-ae3dd2.svg?style=flat)](https://gitter.im/thoughtbot/neat)
[![Stack Overflow](http://img.shields.io/badge/stack%20overflow-neat-ae3dd2.svg?style=flat)](http://stackoverflow.com/questions/tagged/neat)
-## A lightweight, semantic grid framework built with Bourbon
+## A lightweight, semantic grid framework
-Neat is a fluid grid framework built with [Bourbon](https://github.com/thoughtbot/bourbon) with the aim of being easy enough to use out of the box and flexible enough to customize down the road.
+Neat is a fluid grid framework with the aim of being easy enough to use out of the box and flexible enough to customize down the road.
- **[Demo](http://neat.bourbon.io)**
- **[Documentation](http://thoughtbot.github.io/neat-docs/latest)**
@@ -19,7 +19,6 @@ for updates.
## Requirements
- [Sass](https://github.com/sass/sass) 3.3+
-- [Bourbon](https://github.com/thoughtbot/bourbon) 4.0+
- :warning: If you need **Sass 3.2 support**, you should [use Neat 1.5.1](#installing-older-versions-of-neat)
## Installation
@@ -39,23 +38,16 @@ For command line help, visit our wiki page on Neat’s [command line interface](
```bash
gem install sass # or gem update sass
```
- ```bash
- gem install bourbon # or gem update bourbon
- ```
3. Install the Neat library into the current directory:
```bash
- bourbon install # if not already installed
- ```
- ```bash
neat install
```
-4. Import Neat in your stylesheet, after Bourbon:
+4. Import Neat in your stylesheet:
```scss
- @import "bourbon/bourbon";
@import "neat/neat";
```
@@ -81,10 +73,9 @@ For command line help, visit our wiki page on Neat’s [command line interface](
bundle update sass
```
-3. Import Neat in your `application.scss`, after Bourbon:
+3. Import Neat in your `application.scss`:
```scss
- @import "bourbon";
@import "neat";
```
@@ -98,12 +89,11 @@ For command line help, visit our wiki page on Neat’s [command line interface](
npm install --save bourbon-neat
```
-1. If you’re using [Eyeglass](http://eyeglass.rocks), skip to Step 3. Otherwise, you’ll need to add Bourbon and Neat to your node-sass `includePaths` option. `require("bourbon-neat").includePaths` is an array of directories that you should pass to node-sass. How you do this depends on how node-sass is integrated into your project. You will also need to ensure that Bourbon is in the `includePaths` passed to node-sass.
+1. If you’re using [Eyeglass](http://eyeglass.rocks), skip to Step 3. Otherwise, you’ll need to add Neat to your node-sass `includePaths` option. `require("bourbon-neat").includePaths` is an array of directories that you should pass to node-sass. How you do this depends on how node-sass is integrated into your project.
-1. Import Neat into your Sass files, after Bourbon:
+1. Import Neat into your Sass files:
```scss
- @import "bourbon";
@import "neat";
```
@@ -128,15 +118,13 @@ For command line help, visit our wiki page on Neat’s [command line interface](
First off, if you are planning to override the default grid settings (12 columns), it is recommended to create a `_grid-settings.scss` file for that purpose. Make sure to import it right *before* importing Neat:
```scss
-@import "bourbon/bourbon"; // or "bourbon" when in Rails
@import "grid-settings";
@import "neat/neat"; // or "neat" when in Rails
```
In your newly created `_grid-settings.scss`, import `neat-helpers` if you are planning to use `new-breakpoint()`, then define your new variables:
```scss
-@import "bourbon/bourbon"; // or "bourbon" when in Rails
@import "neat/neat-helpers"; // or "neat-helpers" when in Rails
// Change the grid settings
View
@@ -8,15 +8,11 @@ RSpec::Core::RakeTask.new(:spec)
task :default => :spec
task :test do
- puts "Creating a Bourbon directory..."
- `bourbon install --path test`
puts "Generating CSS..."
`sass -I . --watch test:css/ --style expanded`
end
task :clean do
- puts "Deleting Bourbon directory..."
- `rm -rf test/bourbon`
puts "Deleting generated CSS..."
`rm -rf css/`
end
@@ -1,3 +1,6 @@
+// Mixins
+@import "mixins/clearfix";
+
// Functions
@import "functions/private";
@import "functions/new-breakpoint";
@@ -0,0 +1,25 @@
+@charset "UTF-8";
+
+/// Provides an easy way to include a clearfix for containing floats.
+///
+/// @link http://goo.gl/yP5hiZ
+///
+/// @example scss
+/// .element {
+/// @include clearfix;
+/// }
+///
+/// @example css
+/// .element::after {
+/// clear: both;
+/// content: "";
+/// display: block;
+/// }
+
+@mixin clearfix {
+ &::after {
+ clear: both;
+ content: "";
+ display: block;
+ }
+}
@@ -1,16 +1,16 @@
@charset "UTF-8";
-/// Sets the relative width of a single grid column. The unit used should be the same one used to define `$gutter`. To learn more about `modular-scale()` see [Bourbon docs](http://bourbon.io/docs/#modular-scale). Set with a `!global` flag.
+/// Sets the relative width of a single grid column. The unit used should be the same one used to define `$gutter`. Set with a `!global` flag.
///
/// @type Number (Unit)
-$column: modular-scale(3, 1em, $golden) !default;
+$column: 4.2358em !default;
-/// Sets the relative width of a single grid gutter. The unit used should be the same one used to define `$column`. To learn more about `modular-scale()` see [Bourbon docs](http://bourbon.io/docs/#modular-scale). Set with the `!global` flag.
+/// Sets the relative width of a single grid gutter. The unit used should be the same one used to define `$column`. Set with the `!global` flag.
///
/// @type Number (Unit)
-$gutter: modular-scale(1, 1em, $golden) !default;
+$gutter: 1.618em !default;
/// Sets the total number of columns in the grid. Its value can be overridden inside a media query using the `media()` mixin. Set with the `!global` flag.
///
View
@@ -1,6 +1,6 @@
{
"name": "neat",
- "description": "A lightweight, semantic grid framework built with Bourbon",
+ "description": "A lightweight, semantic grid framework",
"version": "1.7.4",
"main": "app/assets/stylesheets/_neat.scss",
"license": "MIT",
@@ -19,7 +19,6 @@
"test"
],
"keywords": [
- "bourbon",
"columns",
"grid",
"layout",
@@ -38,8 +37,5 @@
"repository": {
"type": "git",
"url": "https://github.com/thoughtbot/neat.git"
- },
- "dependencies": {
- "bourbon": ">=4.0"
}
}
View
@@ -1,4 +1,3 @@
-@import "bourbon";
@import "../app/assets/stylesheets/neat";
// Grid Settings
@@ -35,7 +34,7 @@ $darkerblue: #072f44;
body {
color: $darkerblue;
- font-family: $helvetica;
+ font-family: sans-serif;
line-height: $base-line-height;
margin: 0 0 (1.5rem * 2);
text-align: center;
@@ -62,17 +61,17 @@ code {
// ============================================
.container {
- @include margin(null auto);
- @include padding(null $gutter);
+ margin: 0 auto;
max-width: 500px;
+ padding: 0 $gutter;
position: relative;
}
.welcome-message {
@include clearfix();
- @include padding($base-spacing null);
background-color: $blue;
margin-bottom: 1.5rem;
+ padding: $base-spacing 0;
text-align: center;
}
View
@@ -1,5 +1,4 @@
require "sass"
-require "bourbon"
require "neat/generator"
module Neat
@@ -1,20 +1,18 @@
require "fileutils"
require "find"
-namespace :bourbon do
- namespace :neat do
- desc "Copy Neat's files to the Rails assets directory."
- task :install, [:sass_path] do |t, args|
- args.with_defaults(:sass_path => 'public/stylesheets/sass')
- source_root = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
- FileUtils.mkdir_p("#{Rails.root}/#{args.sass_path}/neat")
- FileUtils.cp_r("#{source_root}/app/assets/stylesheets/.", "#{Rails.root}/#{args.sass_path}/neat", { :preserve => true })
+namespace :neat do
+ desc "Copy Neat's files to the Rails assets directory."
+ task :install, [:sass_path] do |t, args|
+ args.with_defaults(:sass_path => 'public/stylesheets/sass')
+ source_root = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
+ FileUtils.mkdir_p("#{Rails.root}/#{args.sass_path}/neat")
+ FileUtils.cp_r("#{source_root}/app/assets/stylesheets/.", "#{Rails.root}/#{args.sass_path}/neat", { :preserve => true })
- Find.find("#{Rails.root}/#{args.sass_path}/neat") do |path|
- if path.end_with?(".css.scss")
- path_without_css_extension = path.gsub(/\.css\.scss$/, ".scss")
- FileUtils.mv(path, path_without_css_extension)
- end
+ Find.find("#{Rails.root}/#{args.sass_path}/neat") do |path|
+ if path.end_with?(".css.scss")
+ path_without_css_extension = path.gsub(/\.css\.scss$/, ".scss")
+ FileUtils.mv(path, path_without_css_extension)
end
end
end
View
@@ -9,11 +9,11 @@ Gem::Specification.new do |s|
s.authors = ['Joel Oliveira', 'Kyle Fiedler', 'Reda Lemeden']
s.email = 'design+bourbon@thoughtbot.com'
s.homepage = 'http://neat.bourbon.io'
- s.summary = 'A lightweight, semantic grid framework built with Bourbon'
+ s.summary = 'A lightweight, semantic grid framework'
s.license = 'MIT'
s.description = <<-DESC
-Neat is a fluid grid framework built with Bourbon with the aim of being easy
-enough to use out of the box and flexible enough to customize down the road.
+Neat is a fluid grid framework built with the aim of being easy enough to use
+out of the box and flexible enough to customize down the road.
DESC
s.rubyforge_project = 'neat'
@@ -23,7 +23,6 @@ enough to use out of the box and flexible enough to customize down the road.
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ['lib']
- s.add_dependency('bourbon', '>= 4.0')
s.add_dependency('sass', '>= 3.3')
s.add_dependency("thor", "~> 0.19")
View
@@ -1,9 +1,8 @@
{
"name": "bourbon-neat",
"version": "1.7.4",
- "description": "A lightweight, semantic grid framework built with Bourbon",
+ "description": "A lightweight, semantic grid framework",
"keywords": [
- "bourbon",
"columns",
"grid",
"layout",
@@ -34,7 +33,6 @@
"test": "echo \"No test specified\""
},
"dependencies": {
- "bourbon": "^4.2",
"node-sass": "^3.4"
},
"devDependencies": {
View
@@ -1,5 +1,5 @@
{
"name": "Neat",
- "description": "A lightweight, semantic grid framework built with Bourbon",
- "tags": ["bourbon", "columns", "grid", "layout", "media", "media-queries", "neat", "queries", "sass", "scss", "semantic"]
+ "description": "A lightweight, semantic grid framework",
+ "tags": ["columns", "grid", "layout", "media", "media-queries", "neat", "queries", "sass", "scss", "semantic"]
}
View
@@ -7,19 +7,16 @@
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
RSpec.configure do |config|
- config.include BourbonSupport
config.include SassSupport
config.include CssParser
config.include ParserSupport
config.include Aruba::Api
config.before(:all) do
- install_bourbon_files
generate_css
end
config.after(:all) do
- remove_bourbon_files
clean_up
end
end
@@ -1,9 +0,0 @@
-module BourbonSupport
- def install_bourbon_files
- `bundle exec bourbon install --path test`
- end
-
- def remove_bourbon_files
- FileUtils.rm_rf("test/bourbon")
- end
-end
View
@@ -1,3 +1,2 @@
-@import "bourbon/bourbon";
@import "../app/assets/stylesheets/neat";
$disable-warnings: true !global;

7 comments on commit 4415490

@clemensg

Hi @meowsus,

this commit breaks gems depending on neat, for example administrate. Can't be fixed with a simple gem 'bourbon' in the project's Gemfile, but must be fixed in the administrate gem itself.

Shouldn't this change be in a major version bump (2.0 ?) where you can break backwards compatibility?

@tysongach
Member

@clemensg This sounds like a bug with Administrate. Can you file an issue there?

@meowsus
Contributor

@clemensg I agree with @clemensg. This does seem like a bug with the Administrate library.

Originally I had thought that this change would be breaking, and was surprised that it was actually released as a minor, but truthfully the functionality did not change and that would support the choice of releasing a minor and not a major version.

@tysongach
Member

It looks like Administrate only specifies Neat as a dependency, but not Bourbon (which it needs): https://github.com/thoughtbot/administrate/blob/master/administrate.gemspec#L22

Up until now, Neat brought in Bourbon which made this a non-issue. But that was fragile and now that Neat doesn’t explicitly declare Bourbon as a dependency, it’s broken.

Here’s a PR to Administrate to try and fix the problem: thoughtbot/administrate#614

@clemensg
clemensg commented on 4415490 Jun 21, 2016 edited

(Removing a dependency which other projects depend upon implicitly, does qualify as a breaking change in my opinion, but) I'm also fine with fixing it in administrate.

Thank you for the quick responses and the pull request! 👍

@tysongach
Member

@clemensg The problem is that Administrate directly uses Bourbon features, but never explicitly declared it as a dependency. It shouldn’t have assumed that Neat would always bring in the Bourbon library for it. It was fragile all along. Outside the context of Administrate, Neat no longer using Bourbon for one function isn’t a breaking change. The output is the same without that function.

@clemensg

OK, sounds reasonable. Thanks for the explanation!

Please sign in to comment.