Skip to content

Commit

Permalink
Merge pull request #352 from clear-y/jc/add-important-param
Browse files Browse the repository at this point in the history
Add important parameter to the edit() mixin
  • Loading branch information
corysimmons committed Sep 15, 2014
2 parents 6c5702c + 03f502f commit a3dd11a
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@

### 6.1.0
- Enhancements
- Add `important` parameter to `edit()` mixin
- Defaults to `false`. When set to `true` it adds the `!important` flag to the CSS to force elements with backgrounds already set to show the debug grid.

### 6.0.0
- Enhancements
- Scss and Stylus version now output identical CSS
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jeet",
"version": "6.0.0",
"version": "6.1.0",
"homepage": "http://jeet.gs",
"authors": [
"Cory Simmons <csimmonswork@gmail.com>",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"main": "stylus/jeet.js",
"version": "6.0.0",
"version": "6.1.0",
"description": "A grid system for humans.",
"keywords": [
"stylus",
Expand Down
13 changes: 10 additions & 3 deletions scss/jeet/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,17 @@
/**
* View the grid and its layers for easy debugging.
* @param {string} [$color=black] - The background tint applied.
* @param {boolean} [$important=false] - Whether to apply the style as !important.
*/
@mixin edit($color: black) {
* {
background: rgba($color, .05);
@mixin edit($color: black, $important: false) {
@if $important {
* {
background: rgba($color, .05) !important;
}
} @else {
* {
background: rgba($color, .05);
}
}
}

Expand Down
11 changes: 8 additions & 3 deletions stylus/jeet/_grid.styl
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,15 @@ unshift()
/**
* View the grid and its layers for easy debugging.
* @param {string} [color=black] - The background tint applied.
* @param {boolean} [important=false] - Whether to apply the style as !important.
*/
edit(color = black)
*
background: rgba(color, 5%)
edit(color = black, important = false)
if important
*
background: rgba(color, 5%) !important
else
*
background: rgba(color, 5%)

/**
* Alias for edit().
Expand Down
2 changes: 2 additions & 0 deletions tests/functions/edit/edit.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import 'scss/jeet/index';

@include edit(blue);

@include edit(blue, $important: true);
2 changes: 2 additions & 0 deletions tests/functions/edit/edit.styl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import 'stylus/jeet/index'

edit(blue)

edit(blue, important: true)

0 comments on commit a3dd11a

Please sign in to comment.