File tree Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -7,14 +7,15 @@ variety of languages and technologies. These are things that don't really
7
7
warrant a full blog post. These are mostly things I learn by pairing with
8
8
smart people at [ Hashrocket] ( http://hashrocket.com/ ) .
9
9
10
- _ 377 TILs and counting..._
10
+ _ 378 TILs and counting..._
11
11
12
12
---
13
13
14
14
### Categories
15
15
16
16
* [ Chrome] ( #chrome )
17
17
* [ Clojure] ( #clojure )
18
+ * [ CSS] ( #css )
18
19
* [ Devops] ( #devops )
19
20
* [ Elixir] ( #elixir )
20
21
* [ Git] ( #git )
@@ -58,6 +59,10 @@ _377 TILs and counting..._
58
59
- [ Type of Anything] ( clojure/type-of-anything.md )
59
60
- [ When Overflow Is Desired] ( clojure/when-overflow-is-desired.md )
60
61
62
+ ### CSS
63
+
64
+ - [ Lighten And Darken With SCSS] ( css/lighten-and-darken-with-scss.md )
65
+
61
66
### Devops
62
67
63
68
- [ Aliasing An Ansible Host] ( devops/aliasing-an-ansible-host.md )
Original file line number Diff line number Diff line change
1
+ # Lighten And Darken With SCSS
2
+
3
+ With SCSS, a color can be lightened or darkened by a certain percentage
4
+ using the
5
+ [ ` lighten ` ] ( http://sass-lang.com/documentation/Sass/Script/Functions.html#lighten-instance_method )
6
+ and
7
+ [ ` darken ` ] ( http://sass-lang.com/documentation/Sass/Script/Functions.html#darken-instance_method )
8
+ functions, respectively.
9
+
10
+ For instance, given the following HTML
11
+
12
+ ``` html
13
+ <div class =' one' ></div >
14
+ <div class =' two' ></div >
15
+ <div class =' three' ></div >
16
+ ```
17
+
18
+ I can style ` div.two ` with the original color and then style ` div.one ` with
19
+ a lightened version and ` div.three ` with a darkened version.
20
+
21
+ ``` scss
22
+ $box-color : #0074d9 ;
23
+
24
+ .two {
25
+ background : $box-color ;
26
+ }
27
+ .one {
28
+ background : lighten ($box-color , 20% );
29
+ }
30
+ .three {
31
+ background : darken ($box-color , 20% );
32
+ }
33
+ ```
34
+
35
+ The result looks something like this:
36
+
37
+ ![ ] ( http://i.imgur.com/SaeTL8H.png )
You can’t perform that action at this time.
0 commit comments