Skip to content

Commit a3dd11a

Browse files
committed
Merge pull request #352 from clear-y/jc/add-important-param
Add important parameter to the edit() mixin
2 parents 6c5702c + 03f502f commit a3dd11a

File tree

7 files changed

+30
-8
lines changed

7 files changed

+30
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2+
### 6.1.0
3+
- Enhancements
4+
- Add `important` parameter to `edit()` mixin
5+
- 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+
17
### 6.0.0
28
- Enhancements
39
- Scss and Stylus version now output identical CSS

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jeet",
3-
"version": "6.0.0",
3+
"version": "6.1.0",
44
"homepage": "http://jeet.gs",
55
"authors": [
66
"Cory Simmons <csimmonswork@gmail.com>",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919
],
2020
"main": "stylus/jeet.js",
21-
"version": "6.0.0",
21+
"version": "6.1.0",
2222
"description": "A grid system for humans.",
2323
"keywords": [
2424
"stylus",

scss/jeet/_grid.scss

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,17 @@
190190
/**
191191
* View the grid and its layers for easy debugging.
192192
* @param {string} [$color=black] - The background tint applied.
193+
* @param {boolean} [$important=false] - Whether to apply the style as !important.
193194
*/
194-
@mixin edit($color: black) {
195-
* {
196-
background: rgba($color, .05);
195+
@mixin edit($color: black, $important: false) {
196+
@if $important {
197+
* {
198+
background: rgba($color, .05) !important;
199+
}
200+
} @else {
201+
* {
202+
background: rgba($color, .05);
203+
}
197204
}
198205
}
199206

stylus/jeet/_grid.styl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,15 @@ unshift()
150150
/**
151151
* View the grid and its layers for easy debugging.
152152
* @param {string} [color=black] - The background tint applied.
153+
* @param {boolean} [important=false] - Whether to apply the style as !important.
153154
*/
154-
edit(color = black)
155-
*
156-
background: rgba(color, 5%)
155+
edit(color = black, important = false)
156+
if important
157+
*
158+
background: rgba(color, 5%) !important
159+
else
160+
*
161+
background: rgba(color, 5%)
157162

158163
/**
159164
* Alias for edit().

tests/functions/edit/edit.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
@import 'scss/jeet/index';
22

33
@include edit(blue);
4+
5+
@include edit(blue, $important: true);

tests/functions/edit/edit.styl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
@import 'stylus/jeet/index'
22

33
edit(blue)
4+
5+
edit(blue, important: true)

0 commit comments

Comments
 (0)