Skip to content

Commit c093aab

Browse files
committedApr 4, 2013
Stripped breakpoint to core files for Bower package
1 parent 42f76f8 commit c093aab

25 files changed

+207
-1080
lines changed
 

‎CHANGELOG.md

+4-21
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,5 @@
1-
# v3.1.0
1+
# 4.0.0
22

3-
* Using Grunt and NPM, ditched Codekit
4-
* Removed Compass as dependency [#46](https://github.com/lesjames/Breakpoint/issues/46)
5-
6-
# v3.0.1 - 3/24/2013
7-
8-
* Merged @darrenscerri box sizing test [#45](https://github.com/lesjames/Breakpoint/pull/45)
9-
10-
# v3.0.0 - 3/6/2013
11-
12-
* Merged @skibblenybbles refactor of JS [#29](https://github.com/lesjames/Breakpoint/pull/29)
13-
* Updated jQuery to 1.9.1
14-
* Updated Modernizr to 2.6.2
15-
* Moved IE conditionals back to HTML tag
16-
* Dropping box-sizing polyfill [#41](https://github.com/lesjames/Breakpoint/issues/41)
17-
* Reorganized JS files into src and lib folders
18-
* Added Codekit configuation file
19-
* Moved grid overlay to a class [#40](https://github.com/lesjames/Breakpoint/issues/40)
20-
* Updated to normalize.css v2.1.0
21-
* Removed cross browser mixins
22-
* Added H5BP opinionated styles
3+
* Removed everything except Breakpoint mixins, grid classes and jquery plugin.
4+
* Moved scaffolding to a seperate project: [Breakpoint Scaffold](https://github.com/lesjames/breakpoint-scaffold)
5+
* Make Breakpoint a Bower package

‎Gruntfile.js

-90
This file was deleted.

‎LICENSE-MIT ‎LICENSE-MIT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2013 Les James (https://github.com/lesjames/Breakpoint)
1+
Copyright (c) 2013 Les James (https://github.com/lesjames/breakpoint)
22

33
Permission is hereby granted, free of charge, to any person
44
obtaining a copy of this software and associated documentation

‎README.md

+11-23
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
***
44

5-
Verson: 3.0.1
5+
NOTICE
6+
7+
Breakpoint has been split into two projects. This is the core project and contains only the Sass needed for the grid system
8+
and the jquery plugin for responsive images. The boilerplate framework has been moved to a seperate repo called
9+
[Breakpoint Scaffold](https://github.com/lesjames/breakpoint-scaffold) and includes this core as a Bower package.
10+
11+
***
612

713
Breakpoint is a grid system and responsive image solution. It's based on the concept that columns shouldn't
814
stretch but get added or taken away as the screen changes size. This concept
@@ -21,25 +27,10 @@ Breakpoint requires Sass 3.2 or later
2127

2228
`$ gem install sass`
2329

24-
You can then start a new Breakpoint project by cloning the repo
25-
26-
`$ git clone https://github.com/lesjames/Breakpoint.git MYPROJECTNAME`
27-
28-
Breakpoint uses NPM, Bower and Grunt.js to manage CSS and JavaScript. Install Node and NPM. Inside of your project directory set up Node dependencies...
29-
30-
`$ npm install`
31-
32-
Download dependencies via Bower...
33-
34-
`$ grunt install`
35-
36-
During development Grunt can watch your JS and Sass files...
37-
38-
`$ grunt watch`
39-
40-
Ready your project for production (minifies your JS and CSS)...
30+
If you don't use [Breakpoint Scaffold](https://github.com/lesjames/breakpoint-scaffold) you can drop the
31+
breakpoint folder into your Sass folder and include Breakpoint with an import.
4132

42-
`$ grunt release`
33+
`@import 'breakpoint/breakpoint'`
4334

4435
### Resources
4536

@@ -199,13 +190,10 @@ You just need to create an element in your HTML to see it. `<div class="grid-ove
199190

200191
Breakpoint uses the following frameworks, technologies and inspirations:
201192

202-
[H5BP](http://html5boilerplate.com/),
203193
[normalize.css](http://necolas.github.com/normalize.css/),
204194
[Griddle](https://github.com/necolas/griddle),
205195
[Frameless Grid](http://framelessgrid.com/),
206196
[Sass](http://sass-lang.com/),
207-
[Compass](http://compass-style.org/),
208197
[Conditional CSS](http://adactio.com/journal/5429/),
209198
[DetectMQ.js](https://github.com/viljamis/detectMQ.js),
210-
[jQuery](http://jquery.com/),
211-
[Modernizr](http://modernizr.com/)
199+
[jQuery](http://jquery.com/)

‎breakpoint/_breakpoint.scss

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Grid Variables
2+
// ==========================================================================
3+
4+
$grid-column: 60px !default;
5+
$grid-gutter: 20px !default;
6+
$base-font-size: 16px !default;
7+
$grid-direction: left !default;
8+
9+
// generate visual grid overlay on class .grid-overlay
10+
$grid-overlay: false !default;
11+
12+
// fallback breakpoint (column count for < IE9)
13+
$ie-support: false !default;
14+
15+
// label for your mobile first breakpoint
16+
$breakpoint-list: 'small' !default;
17+
18+
@import 'core';
19+
@import 'grid'

‎breakpoint/_core.scss

+165
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
// Vars and Functions
2+
// =============================================================================
3+
4+
$breakpoint-list: unquote($breakpoint-list);
5+
$current-bp: 0; // init breakpoint variable
6+
7+
// converting px to em
8+
@function em($px, $base: $base-font-size) { @return ($px / $base) * 1em; }
9+
10+
// creates percentage width
11+
@function fluid($col, $avail: $current-bp) { @return (100% / $avail) * $col }
12+
13+
// creates em width
14+
// pass false as a second argument to remove the built in gutter (for creating height measurements)
15+
@function fixed($col, $gutter: true) {
16+
@if ($gutter) { @return $col * ( em($grid-column + $grid-gutter) ) }
17+
@else { @return $col * ( em($grid-column + $grid-gutter) ) - em($grid-gutter) }
18+
}
19+
20+
21+
// Javascript hook for current breakpoint label
22+
// =============================================================================
23+
24+
@media (min-width: 0px) {
25+
body::before { content: "#{nth($breakpoint-list, 1)}"; display: none; }
26+
}
27+
28+
29+
// Breakpoint mixin
30+
// =============================================================================
31+
32+
@mixin breakpoint($min: false, $max: false, $label: false, $orientation: false, $wrapper: true, $resolution: false) {
33+
34+
// set warnings if arguments are invalid
35+
@if ($min == false and $max == false and $label == false and $orientation == false and $wrapper == true and $resolution == false) {
36+
@warn "breakpoint requires you to pass some kind of argument. It can't read your mind. :)";
37+
}
38+
@if ($min == 0 and $max == false and $label == false and $orientation == false and $wrapper == true and $resolution == false) {
39+
@warn "If you pass zero as a minimum you need to specify a max column value.";
40+
}
41+
42+
// set current breakpoint for fluid function
43+
$current-bp: $min;
44+
45+
// min width mq
46+
@if ($min and $max == false) {
47+
@if ($min > 0) {
48+
// create min width mq
49+
// can we remove duplication of code here?
50+
@if ($orientation) {
51+
@media ( min-width: (fixed($min) + em($grid-gutter)) * ($base-font-size / 16px) ) and ( orientation: $orientation ) {
52+
@include breakpoint-extras($min, $wrapper, $label, $grid-overlay) { @content };
53+
}
54+
} @else {
55+
@media ( min-width: (fixed($min) + em($grid-gutter)) * ($base-font-size / 16px) ) {
56+
@include breakpoint-extras($min, $wrapper, $label, $grid-overlay) { @content };
57+
}
58+
}
59+
// ie fallback
60+
@if ($ie-support and $min <= $ie-support and $orientation == false) {
61+
.lt-ie9 {
62+
@include breakpoint-extras($min, $wrapper, $label: false, $grid-overlay: false) { @content };
63+
}
64+
}
65+
}
66+
}
67+
68+
// max width mq
69+
@if ($max) {
70+
// create max only mq
71+
@if ($min == 0 or $min == false) {
72+
@if ($orientation) {
73+
@media ( max-width: fixed($max) + em($grid-gutter) * ($base-font-size / 16px) ) and ( orientation: $orientation ) { @content }
74+
} @else {
75+
@media ( max-width: fixed($max) + em($grid-gutter) * ($base-font-size / 16px) ) { @content }
76+
}
77+
// create min and max mq
78+
} @else {
79+
@if ($orientation) {
80+
@media ( min-width: fixed($min) + em($grid-gutter) * ($base-font-size / 16px) ) and ( max-width: fixed($max) + em($grid-gutter) ) and ( orientation: $orientation ) { @content }
81+
} @else {
82+
@media ( min-width: fixed($min) + em($grid-gutter) * ($base-font-size / 16px) ) and ( max-width: fixed($max) + em($grid-gutter) ) { @content }
83+
}
84+
}
85+
}
86+
87+
// orientation only mq
88+
@if ($min == false and $max == false) {
89+
@if ($orientation) {
90+
@media ( orientation: $orientation ) { @content }
91+
}
92+
}
93+
94+
// pixel ratio mq
95+
@if ($resolution) {
96+
// warn if invalid value
97+
@if ($resolution != 'high' and $resolution != 'low') {
98+
@warn "$resolution only supports values of 'high' or 'low'";
99+
}
100+
@if ($resolution == 'high') {
101+
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) { @content }
102+
}
103+
@if ($resolution == 'low') {
104+
@media (-webkit-max-device-pixel-ratio: 1.5), (max-resolution: 144dpi) { @content }
105+
}
106+
// ie fallback
107+
@if ($ie-support and $resolution == 'low') {
108+
.lt-ie9 { @content }
109+
}
110+
}
111+
}
112+
113+
// private mixin for generating extras in a min width mq
114+
@mixin breakpoint-extras($min, $wrapper, $label, $grid-overlay) {
115+
@if($grid-overlay) { @include grid-overlay($min); }
116+
117+
// create hook for js
118+
@if($label) {
119+
120+
// label current breakpoint
121+
body::before { content: $label; }
122+
123+
// push label to label list names = push(names, myname)
124+
$breakpoint-list: append($breakpoint-list, unquote($label), comma);
125+
126+
}
127+
// proper sizing of wrapper
128+
129+
@if($wrapper) { .wrapper { width: fixed($min) - em($grid-gutter); } }
130+
131+
@content
132+
}
133+
134+
// Grid overlay
135+
// =============================================================================
136+
137+
@mixin grid-overlay($col: false) {
138+
.grid-overlay {
139+
position: fixed; top: 0; bottom: 0; pointer-events: none; z-index: 10000;
140+
141+
$overlay-color: transparentize(red, .9);
142+
background: -webkit-linear-gradient(left, transparent $grid-gutter, $overlay-color $grid-gutter, $overlay-color $grid-gutter + $grid-column);
143+
background: -moz-linear-gradient(left, transparent $grid-gutter, $overlay-color $grid-gutter, $overlay-color $grid-gutter + $grid-column);
144+
background: -o-linear-gradient(left, transparent $grid-gutter, $overlay-color $grid-gutter, $overlay-color $grid-gutter + $grid-column);
145+
background: linear-gradient(left, transparent $grid-gutter, $overlay-color $grid-gutter, $overlay-color $grid-gutter + $grid-column);
146+
147+
@if ($col) {
148+
left: 50%;
149+
width: fixed($col) + em($grid-gutter);
150+
margin-left: fixed($col) / -2 - (em($grid-gutter)/2);
151+
-webkit-background-size: $grid-gutter + $grid-column;
152+
-moz-background-size: $grid-gutter + $grid-column;
153+
-o-background-size: $grid-gutter + $grid-column;
154+
background-size: $grid-gutter + $grid-column;
155+
} @else {
156+
left: 0;
157+
right: $grid-gutter;
158+
-webkit-background-size: 25%;
159+
-moz-background-size: 25%;
160+
-o-background-size: 25%;
161+
background-size: 25%;
162+
}
163+
}
164+
}
165+
@if($grid-overlay) { @include grid-overlay; }

‎static/sass/framework/_grid-core.scss ‎breakpoint/_grid.scss

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
/* Grid based on https://github.com/necolas/griddle by Nicolas Gallagher (@necolas) */
2-
3-
// Grid Core
4-
// =============================================================================
1+
/*! Grid based on https://github.com/necolas/griddle by Nicolas Gallagher (@necolas) */
52

63
// establish base font size in config so that media queries can be resized if the base context chagnes
74
body { font-size: em($base-font-size, 16px); }
@@ -81,15 +78,11 @@ img { max-width: 100%; }
8178
}
8279

8380
// Modifier: horizontally center all grid units
84-
// Allows for automatic unit centering irrespective of the number of
85-
// units in the grid.
8681
.grid--center {
8782
text-align: center;
8883
}
8984

9085
// Modifier: horizontally center one unit
91-
// Set a specific unit to be horizontally centered. Doesn't affect
92-
// any other units. Can still contain a child `grid` object.
9386
.grid__cell--center {
9487
display: block;
9588
margin: 0 auto;

‎component.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
2-
"dependencies": {
3-
"jquery": "latest",
4-
"modernizr": "latest"
5-
}
2+
"name": "breakpoint",
3+
"version": "4.0.0",
4+
"author": "Les James",
5+
"homepage": "https://github.com/lesjames/breakpoint",
6+
"main": ['breakpoint/_breakpoint.scss', 'breakpoint/_core.scss', 'breakpoint/_grid.scss','jquery.breakpoint.js'],
7+
"ignore": "**/*.md"
68
}

‎index.html

-27
This file was deleted.
File renamed without changes.

‎package.json

-16
This file was deleted.

‎static/css/.gitignore

Whitespace-only changes.

‎static/fonts/.gitignore

Whitespace-only changes.

‎static/img/.gitignore

Whitespace-only changes.

‎static/js/src/breakpoint-bindings.js

-1
This file was deleted.

‎static/js/src/polyfills.js

-46
This file was deleted.

‎static/js/src/script.js

-26
This file was deleted.

‎static/sass/_components.scss

-2
This file was deleted.

‎static/sass/_config.scss

-47
This file was deleted.

‎static/sass/_framework.scss

-4
This file was deleted.

‎static/sass/_structure.scss

-2
This file was deleted.

‎static/sass/framework/_grid-helpers.scss

-179
This file was deleted.

‎static/sass/framework/_normalize.scss

-489
This file was deleted.

‎static/sass/framework/_print.scss

-76
This file was deleted.

‎static/sass/style.scss

-18
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.