Skip to content

Commit cedacf5

Browse files
authored
Merge pull request #29 from treehouse/add_categories_to_leap
Add topic categories to Leap
2 parents 06974e0 + 3824d03 commit cedacf5

17 files changed

+563
-2165
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Leap is an internal CSS library made for Treehouse. It contains immutable utilit
44
## Quick Start
55
Several options are available for installing Leap into your project.
66

7-
* [Download the latest release](https://github.com/treehouse/project-leap/archive/v0.9.2.zip)
7+
* [Download the latest release](https://github.com/treehouse/project-leap/archive/v0.10.0.zip)
88

99
* Clone the repo: `git clone https://github.com/treehouse/project-leap.git`
1010
* Install with [Bower](http://bower.io)

_sass/leap/_variables.scss

Lines changed: 42 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -42,137 +42,52 @@ $ui-colors: (
4242
"success": #24793d
4343
);
4444

45-
// Topic Colors
46-
$topic-colors: (
47-
"html": (
48-
light: #62bedb,
49-
base: #39ADD1,
50-
dark: #298fae,
51-
),
52-
"css": (
53-
light: #4494ca,
54-
base: #3079AB,
55-
dark: #255d83,
56-
),
57-
"js": (
58-
light: #d07e94,
59-
base: #c25975,
60-
dark: #aa3e5b,
61-
),
62-
"ruby": (
63-
light: #e97d82,
64-
base: #e15258,
65-
dark: #d9272e,
66-
),
67-
"business": (
68-
light: #fba98c,
69-
base: #F9845B,
70-
dark: #f75f2a,
71-
),
72-
"wordpress": (
73-
light: #a6add7,
74-
base: #838CC7,
75-
dark: #606bb7,
76-
),
77-
"php": (
78-
light: #9885b2,
79-
base: #7D669E,
80-
dark: #645180,
81-
),
82-
"ios": (
83-
light: #78c9c4,
84-
base: #53BBB4,
85-
dark: #3e9d97,
86-
),
87-
"android": (
88-
light: #80c783,
89-
base: #5cb860,
90-
dark: #449d48,
45+
// Category colors
46+
$category-colors: (
47+
"back-end": (
48+
light: lighten(#008297,5%),
49+
base: #008297,
50+
dark: darken(#008297,5%),
51+
),
52+
"data": (
53+
light: lighten(#9F4B84,5%),
54+
base: #9F4B84,
55+
dark: darken(#9F4B84,5%),
9156
),
9257
"design": (
93-
light: #efaf3c,
94-
base: #e59a13,
95-
dark: #b67a0f,
96-
),
97-
"devtools": (
98-
light: #7f94a8,
99-
base: #637a91,
100-
dark: #4e6173,
101-
),
102-
"java": (
103-
light: #38bd95,
104-
base: #2c9676,
105-
dark: #206f57,
106-
),
107-
"python": (
108-
light: #f6bfd0,
109-
base: #f092b0,
110-
dark: #ea6590,
111-
),
112-
"diglit": (
113-
light: #d6b1e2,
114-
base: #c38cd4,
115-
dark: #b067c6,
116-
),
117-
"gamedev": (
118-
light: #29b2b6,
119-
base: #20898c,
120-
dark: #176062,
121-
),
122-
"csharp": (
123-
light: #b6689c,
124-
base: #9e4d83,
125-
dark: #7c3c67,
126-
),
127-
"databases": (
128-
light: #ef9557,
129-
base: #eb7728,
130-
dark: #cd5e13,
131-
),
132-
"virtual-reality": (
133-
light: #b5e296,
134-
base: #95D26C,
135-
dark: #6c9e4a,
136-
),
137-
"apis": (
138-
light: #c36479,
139-
base: #993c50,
140-
dark: #712e3d,
141-
),
142-
"go": (
143-
light: #4371cf,
144-
base: #375eab,
145-
dark: #284683,
146-
),
147-
"data-analysis": (
148-
light: #8d81ab,
149-
base: #645a7e,
150-
dark: #4f4667,
151-
),
152-
"security": (
153-
light: #D1897D,
154-
base: #C66C5D,
155-
dark: #955146,
156-
),
157-
"quality-assurance": (
158-
light: #A560B5,
159-
base: #80438E,
160-
dark: #60226F,
161-
),
162-
"machine-learning": (
163-
light: #459F7F,
164-
base: #2D6853,
165-
dark: #214d3d,
166-
),
167-
"learning-resources": (
168-
light: #569CAD,
169-
base: #38798A,
170-
dark: #19596A,
58+
light: lighten(#4a4290,5%),
59+
base: #4a4290,
60+
dark: darken(#4a4290,5%),
61+
),
62+
"experimental": (
63+
light: lighten(#733a88,5%),
64+
base: #733a88,
65+
dark: darken(#733a88,5%),
66+
),
67+
"front-end": (
68+
light: lighten(#3659a2,5%),
69+
base: #3659a2,
70+
dark: darken(#3659a2,5%),
71+
),
72+
"fundamentals": (
73+
light: lighten(#9b3b5a,5%),
74+
base: #9b3b5a,
75+
dark: darken(#9b3b5a,5%),
76+
),
77+
"mobile": (
78+
light: lighten(#30826C,5%),
79+
base: #30826C,
80+
dark: darken(#30826C,5%),
81+
),
82+
"internal": (
83+
light: lighten(#55616c,5%),
84+
base: #55616c,
85+
dark: darken(#55616c,5%),
17186
),
17287
"undefined": (
173-
light: #8c959d,
174-
base: #717b85,
175-
dark: #5a6269,
88+
light: lighten(#55616c,5%),
89+
base: #55616c,
90+
dark: darken(#55616c,5%),
17691
)
17792
);
17893

_sass/leap/atoms/_button.sass

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -203,28 +203,28 @@
203203
// Extra Large button classes
204204
+button(xl, min-width $xl)
205205

206-
// Topic color buttons
207-
@each $topic, $name in $topic-colors
208-
&--topic-#{$topic}
209-
border-color: topic-color(#{$topic}, base) !important
210-
color: topic-color(#{$topic}, base) !important
206+
@each $category, $name in $category-colors
207+
&--category-#{$category}
208+
border-color: category-color(#{$category}, base) !important
209+
color: category-color(#{$category}, base) !important
211210
svg
212-
fill: topic-color(#{$topic}, base) !important
211+
fill: category-color(#{$category}, base) !important
213212
+selected
214-
border-color: darken(topic-color(#{$topic}, base), 10%) !important
215-
color: darken(topic-color(#{$topic}, base), 10%) !important
213+
border-color: darken(category-color(#{$category}, base), 10%) !important
214+
color: darken(category-color(#{$category}, base), 10%) !important
216215
svg
217-
fill: darken(topic-color(#{$topic}, base), 10%) !important
216+
fill: darken(category-color(#{$category}, base), 10%) !important
218217
&.button--primary
219-
background-color: topic-color(#{$topic}, base) !important
220-
border-color: topic-color(#{$topic}, base) !important
218+
background-color: category-color(#{$category}, base) !important
219+
border-color: category-color(#{$category}, base) !important
221220
color: #fff !important
222221
+selected
223-
background-color: darken(topic-color(#{$topic}, base), 10%) !important
224-
border-color: darken(topic-color(#{$topic}, base), 10%) !important
222+
background-color: darken(category-color(#{$category}, base), 10%) !important
223+
border-color: darken(category-color(#{$category}, base), 10%) !important
225224
svg
226225
fill: #fff !important
227226

227+
228228
// Split Buttons
229229
.split-button &
230230
float: left

_sass/leap/atoms/_color.sass

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,8 @@ $properties: fill stroke color border-color background-color
100100
.text-#{$property}-#{$color-name}
101101
#{$property}: text-color($color-name) !important
102102

103-
104-
105-
// Iterate through topic-colors map to create colors for classes
106-
@each $color-name, $color in $topic-colors
103+
// Iterate through category-colors map to create colors for classes
104+
@each $color-name, $color in $category-colors
107105
@each $color-value, $color-hex in $color
108106

109107
// Iterate through properties var to create properties for classes
@@ -117,11 +115,11 @@ $properties: fill stroke color border-color background-color
117115
//
118116
// Else just use the regular property name
119117
@if $property == background-color
120-
.topic-bg-#{$color-name}-#{$color-value}
118+
.category-bg-#{$color-name}-#{$color-value}
121119
#{$property}: map-get($color, $color-value) !important
122120
@else if $property == border-color
123-
.topic-border-#{$color-name}-#{$color-value}
121+
.category-border-#{$color-name}-#{$color-value}
124122
#{$property}: map-get($color, $color-value) !important
125123
@else
126-
.topic-#{$property}-#{$color-name}-#{$color-value}
124+
.category-#{$property}-#{$color-name}-#{$color-value}
127125
#{$property}: map-get($color, $color-value) !important

_sass/leap/functions/_all.sass

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
@import ui-color
77
@import text-color
88
@import gray-color
9-
@import topic-color
9+
@import category-color
1010
@import brand-color
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@function category-color($key, $value)
2+
@return map-get(map-get($category-colors, #{$key}), #{$value})

_sass/leap/functions/_topic-color.sass

Lines changed: 0 additions & 2 deletions
This file was deleted.

_sass/styleguide/_theme.sass

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ body
104104
color: rgba(#fff, 0.5)
105105
font-family: Helvetica, Arial, sans-serif
106106
&.topic-bg-python-lightest
107-
color: topic-color(python, base)
107+
color: category-color(back-end, base)
108108
em
109-
color: topic-color(python, lighter)
109+
color: category-color(back-end, lighter)
110110
&.topic-bg-diglit-lightest
111-
color: topic-color(diglit, base)
111+
color: category-color(fundamentals, base)
112112
em
113-
color: topic-color(diglit, lighter)
113+
color: category-color(fundamentals, lighter)
114114
&.bg-gray,
115115
&.bg-gray-light,
116116
&.bg-gray-lighter
@@ -127,6 +127,7 @@ body
127127
color: text-color(dark)
128128
em
129129
color: text-color(light)
130+
&-colors-category,
130131
&-colors-topic,
131132
&-colors-gray,
132133
&-colors-text

buttons.html

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -158,48 +158,48 @@ <h2 id="Inline" class="m-b-1-xs" id="disabled">Inline Buttons</h2>
158158

159159

160160

161-
<h2 id="Topics" class="m-b-1-xs" id="topic-color-button">Topic Color Buttons</h2>
162-
<p class="m-b-3-xs">Each button supports the full array of topic colors by adding the name of the topic to the class. Use classes like, <code>button--topic-css</code>, in conjunction with any other button class combo to set it as a topic color. By default, this will effect the border and text color of the button. To use the primary button style with topic colors apply the topic color class in conjunction with the <code>button--primary</code> class.</p>
161+
<h2 id="Categories" class="m-b-1-xs" id="category-color-button">Category Color Buttons</h2>
162+
<p class="m-b-3-xs">Each button supports the full array of topic colors by adding the name of the category to the class. Use classes like, <code>button--category-fundamentals</code>, in conjunction with any other button class combo to set it as a category color. By default, this will effect the border and text color of the button. To use the primary button style with topic colors apply the category color class in conjunction with the <code>button--primary</code> class.</p>
163163
<div class="m-b-05-xs">
164-
<a class="m-b-05-xs button button--topic-html">HTML</a>
165-
<a class="m-b-05-xs button button--topic-css">CSS</a>
166-
<a class="m-b-05-xs button button--topic-java">Java</a>
167-
<a class="m-b-05-xs button button--topic-python">Python</a>
168-
<a class="m-b-05-xs button button--topic-php">PHP</a>
169-
<a class="m-b-05-xs button button--topic-android">Android</a>
170-
<a class="m-b-05-xs button button--topic-ios">iOS</a>
171-
<a class="m-b-05-xs button button--topic-diglit">Digital Literacy</a>
164+
<a class="m-b-05-xs button button button--category-fundamentals">Fundamentals</a>
165+
<a class="m-b-05-xs button button button--category-front-end">Front End</a>
166+
<a class="m-b-05-xs button button button--category-back-end">Back End</a>
167+
<a class="m-b-05-xs button button button--category-data">Data</a>
168+
<a class="m-b-05-xs button button button--category-design">Design</a>
169+
<a class="m-b-05-xs button button button--category-mobile">Mobile</a>
170+
<a class="m-b-05-xs button button button--category-experimental">Experimental</a>
171+
<a class="m-b-05-xs button button button--category-undefined">Undefined</a>
172172
</div>
173173
<div>
174-
<a class="m-b-05-xs button button--primary button--topic-html">HTML</a>
175-
<a class="m-b-05-xs button button--primary button--topic-css">CSS</a>
176-
<a class="m-b-05-xs button button--primary button--topic-java">Java</a>
177-
<a class="m-b-05-xs button button--primary button--topic-python">Python</a>
178-
<a class="m-b-05-xs button button--primary button--topic-php">PHP</a>
179-
<a class="m-b-05-xs button button--primary button--topic-android">Android</a>
180-
<a class="m-b-05-xs button button--primary button--topic-ios">iOS</a>
181-
<a class="m-b-05-xs button button--primary button--topic-diglit">Digital Literacy</a>
174+
<a class="m-b-05-xs button button--primary button--category-fundamentals">Fundamentals</a>
175+
<a class="m-b-05-xs button button--primary button--category-front-end">Front End</a>
176+
<a class="m-b-05-xs button button--primary button--category-back-end">Back End</a>
177+
<a class="m-b-05-xs button button--primary button--category-data">Data</a>
178+
<a class="m-b-05-xs button button--primary button--category-design">Design</a>
179+
<a class="m-b-05-xs button button--primary button--category-mobile">Mobile</a>
180+
<a class="m-b-05-xs button button--primary button--category-experimental">Experimental</a>
181+
<a class="m-b-05-xs button button--primary button--category-undefined">Undefined</a>
182182
</div>
183183
<div class="guide-code m-b-4-xs">
184184
<pre><code class="language-html">&lt;div class="m-b-05-xs"&gt;
185-
&lt;a class="m-b-05-xs button button--topic-html"&gt;HTML&lt;/a&gt;
186-
&lt;a class="m-b-05-xs button button--topic-css"&gt;CSS&lt;/a&gt;
187-
&lt;a class="m-b-05-xs button button--topic-java"&gt;Java&lt;/a&gt;
188-
&lt;a class="m-b-05-xs button button--topic-python"&gt;Python&lt;/a&gt;
189-
&lt;a class="m-b-05-xs button button--topic-php"&gt;PHP&lt;/a&gt;
190-
&lt;a class="m-b-05-xs button button--topic-android"&gt;Android&lt;/a&gt;
191-
&lt;a class="m-b-05-xs button button--topic-ios"&gt;iOS&lt;/a&gt;
192-
&lt;a class="m-b-05-xs button button--topic-diglit"&gt;Digital Literacy&lt;/a&gt;
185+
&lt;a class="m-b-05-xs button button--category-fundamentals"&gt;Fundamentals&lt;/a&gt;
186+
&lt;a class="m-b-05-xs button button--category-front-end"&gt;Front End&lt;/a&gt;
187+
&lt;a class="m-b-05-xs button button--category-back-end"&gt;Back End&lt;/a&gt;
188+
&lt;a class="m-b-05-xs button button--category-data"&gt;Data&lt;/a&gt;
189+
&lt;a class="m-b-05-xs button button--category-design"&gt;Design&lt;/a&gt;
190+
&lt;a class="m-b-05-xs button button--category-mobile"&gt;Mobile&lt;/a&gt;
191+
&lt;a class="m-b-05-xs button button--category-experimental"&gt;Experimental&lt;/a&gt;
192+
&lt;a class="m-b-05-xs button button--category-undefined"&gt;Undefined&lt;/a&gt;
193193
&lt;/div&gt;
194194
&lt;div&gt;
195-
&lt;a class="m-b-05-xs button button--primary button--topic-html"&gt;HTML&lt;/a&gt;
196-
&lt;a class="m-b-05-xs button button--primary button--topic-css"&gt;CSS&lt;/a&gt;
197-
&lt;a class="m-b-05-xs button button--primary button--topic-java"&gt;Java&lt;/a&gt;
198-
&lt;a class="m-b-05-xs button button--primary button--topic-python"&gt;Python&lt;/a&gt;
199-
&lt;a class="m-b-05-xs button button--primary button--topic-php"&gt;PHP&lt;/a&gt;
200-
&lt;a class="m-b-05-xs button button--primary button--topic-android"&gt;Android&lt;/a&gt;
201-
&lt;a class="m-b-05-xs button button--primary button--topic-ios"&gt;iOS&lt;/a&gt;
202-
&lt;a class="m-b-05-xs button button--primary button--topic-diglit"&gt;Digital Literacy&lt;/a&gt;
195+
&lt;a class="m-b-05-xs button button--primary button--category-fundaments"&gt;Fundamentals&lt;/a&gt;
196+
&lt;a class="m-b-05-xs button button--primary button--category-front-end"&gt;Front End&lt;/a&gt;
197+
&lt;a class="m-b-05-xs button button--primary button--category-back-end"&gt;Back End&lt;/a&gt;
198+
&lt;a class="m-b-05-xs button button--primary button--category-data"&gt;Data&lt;/a&gt;
199+
&lt;a class="m-b-05-xs button button--primary button--category-design"&gt;Design&lt;/a&gt;
200+
&lt;a class="m-b-05-xs button button--primary button--category-mobile"&gt;Mobile&lt;/a&gt;
201+
&lt;a class="m-b-05-xs button button--primary button--category-experimental"&gt;Experimental&lt;/a&gt;
202+
&lt;a class="m-b-05-xs button button--primary button--category-undefined"&gt;Undefined&lt;/a&gt;
203203
&lt;/div&gt;</code></pre>
204204
</div>
205205

0 commit comments

Comments
 (0)