Skip to content

Commit 7235e33

Browse files
authored
Merge pull request #461 from Wikia/pills
Pills
2 parents cbb9e8d + 41fb19a commit 7235e33

File tree

10 files changed

+1715
-1708
lines changed

10 files changed

+1715
-1708
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fandom/design-system",
3-
"version": "23.24.0",
3+
"version": "23.24.1-test.3",
44
"description": "Design System developed for Fandom",
55
"keywords": [
66
"ember-addon"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
@import '../wds-mixins/pill-theming';
2+
3+
.wds-pills {
4+
display: flex;
5+
list-style: none;
6+
margin: 0;
7+
padding: 0;
8+
flex-wrap: wrap;
9+
}
10+
11+
.wds-pill {
12+
@include pill-theming($wds-fandom-color-black, $wds-fandom-color-middle-gray, $wds-fandom-color-button-background);
13+
14+
border-style: solid;
15+
border-width: 1px;
16+
border-radius: 27px;
17+
display: inline-block;
18+
font-size: $wds-font-size-s;
19+
font-weight: $wds-font-weight-medium;
20+
letter-spacing: 0.25px;
21+
line-height: $wds-line-height-none;
22+
margin: 3px 6px 3px 0;
23+
24+
&__label {
25+
align-items: center;
26+
display: inline-flex;
27+
padding: 9px 12px;
28+
white-space: nowrap;
29+
30+
.wds-icon {
31+
margin-right: 6px;
32+
}
33+
}
34+
35+
&.wds-is-active {
36+
cursor: default;
37+
font-weight: $wds-font-weight-bold;
38+
}
39+
40+
&:last-child {
41+
margin-right: 0;
42+
}
43+
}

style-guide/styles/wds-components/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
@import 'menu-chevron';
1616
@import 'no-scroll';
1717
@import 'on-site-notifications';
18+
@import 'pills';
1819
@import 'player';
1920
@import 'search-modal';
2021
@import 'spinner';

style-guide/styles/wds-mixins/_dropdown-theming.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
color: $color-text;
2727
}
2828

29-
&:hover {
29+
&:hover, &.wds-is-selected {
3030
> a:not(.wds-button) {
3131
background-color: rgba($color-links, .1);
3232
color: $color-links;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@mixin pill-theming($text-color, $border-color, $active-color) {
2+
background-color: rgba($text-color, 0.05);
3+
border-color: $border-color;
4+
5+
.wds-pill__label {
6+
color: $text-color;
7+
}
8+
9+
&.wds-is-active {
10+
background-color: rgba($active-color, 0.15);
11+
border-color: $active-color;
12+
}
13+
}

style-guide/styles/wds-mixins/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
@import 'is-disabled';
99
@import 'is-right-aligned';
1010
@import 'link-theming';
11+
@import 'pill-theming';
1112
@import 'scrollable-list';
1213
@import 'square';
1314
@import 'tabs-theming';

tests/dummy/app/controllers/application.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ export default Controller.extend({
9999
name: 'Toggles',
100100
location: 'route-components.toggles'
101101
},
102+
{
103+
name: 'Pills',
104+
location: 'route-components.pills'
105+
},
102106
{
103107
name: 'Dropdowns',
104108
location: 'route-components.dropdowns'

tests/dummy/app/router.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Router.map(function () {
4242
this.route('floating-buttons');
4343
this.route('dialogs');
4444
this.route('toggles');
45+
this.route('pills');
4546
this.route('dropdowns');
4647
this.route('lists');
4748
this.route('progress-indicators');
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<h1>Pills</h1>
2+
<p>
3+
Use pills for elements like tags and other kinds of metadata.
4+
</p>
5+
6+
<section>
7+
<h2 id="pills">Pills</h2>
8+
9+
<p>
10+
Add <code class="format-code">.wds-is-active</code> class to
11+
<code class="format-code">.wds-pill</code> element to mark it as active.
12+
</p>
13+
14+
<div class="component-demo">
15+
<div class="component-demo__rendered">
16+
<ul class="wds-pills">
17+
<li class="wds-pill">
18+
<a href="#" class="wds-pill__label">
19+
<Icon @name="poll" @size="tiny" />
20+
Default pill
21+
</a>
22+
</li>
23+
<li class="wds-pill wds-is-active">
24+
<span class="wds-pill__label">
25+
<Icon @name="quiz" @size="tiny" />
26+
Active pill
27+
</span>
28+
</li>
29+
</ul>
30+
</div>
31+
32+
<pre>
33+
&lt;ul class="wds-pills"&gt;
34+
&lt;li class="wds-pill"&gt;
35+
&lt;a href="#" class="wds-pill__label"&gt;
36+
&lt;Icon @name="poll" @size="tiny" /&gt;
37+
Default pill
38+
&lt;/a&gt;
39+
&lt;/li&gt;
40+
&lt;li class="wds-pill wds-is-active"&gt;
41+
&lt;span class="wds-pill__label"&gt;
42+
&lt;Icon @name="quiz" @size="tiny" /&gt;
43+
Active pill
44+
&lt;/span&gt;
45+
&lt;/li&gt;
46+
&lt;/ul&gt;
47+
</pre>
48+
</div>
49+
</section>

0 commit comments

Comments
 (0)