Skip to content

Commit 69c3f8c

Browse files
committed
WIP Simplify style
1 parent a351c12 commit 69c3f8c

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

browser/components/TagListItem.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import CSSModules from 'browser/lib/CSSModules'
1717
const TagListItem = ({name, handleClickTagListItem, handleClickNarrowToTag, isActive, isRelated, count}) => (
1818
<div styleName='tagList-itemContainer'>
1919
{isRelated
20-
? <button styleName={isActive ? 'tagList-itemNarrow-active' : 'tagList-itemNarrow'} onClick={() => handleClickNarrowToTag(name)}>
21-
<i className={isActive ? 'fa fa-minus-circle' : 'fa fa-plus-circle'} />
22-
</button>
23-
: <div styleName={isActive ? 'tagList-itemNarrow-active' : 'tagList-itemNarrow'}></div>
20+
? <button styleName={isActive ? 'tagList-item-narrow-active' : 'tagList-item-narrow'} onClick={() => handleClickNarrowToTag(name)}>
21+
<i className={isActive ? 'fa fa-minus-circle' : 'fa fa-plus-circle'} />
22+
</button>
23+
: <div styleName={isActive ? 'tagList-item-narrow-active' : 'tagList-item-narrow'} />
2424
}
2525
<button styleName={isActive ? 'tagList-item-active' : 'tagList-item'} onClick={() => handleClickTagListItem(name)}>
2626
<span styleName='tagList-item-name'>

browser/components/TagListItem.styl

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.tagList-itemContainer
22
display flex
33

4-
.tagList-item, .tagList-itemNarrow
4+
.tagList-item
55
height 26px
66
background-color transparent
77
color $ui-inactive-text-color
@@ -26,10 +26,11 @@
2626
width 100%
2727
padding 0
2828

29-
.tagList-itemNarrow
29+
.tagList-item-narrow
30+
composes tagList-item
3031
padding 0 4px
3132

32-
.tagList-item-active, .tagList-itemNarrow-active
33+
.tagList-item-active
3334
background-color $ui-button-default--active-backgroundColor
3435
height 26px
3536
margin-bottom 5px
@@ -48,7 +49,8 @@
4849
width 100%
4950
padding 0
5051

51-
.tagList-itemNarrow-active
52+
.tagList-item-narrow-active
53+
composes tagList-item-active
5254
padding 0 4px
5355

5456
.tagList-item-name
@@ -67,7 +69,7 @@
6769
padding 0 3px
6870

6971
body[data-theme="white"]
70-
.tagList-item, .tagList-itemNarrow
72+
.tagList-item
7173
color $ui-inactive-text-color
7274
&:hover
7375
color $ui-text-color
@@ -76,7 +78,7 @@ body[data-theme="white"]
7678
color $ui-text-color
7779
background-color $ui-button--active-backgroundColor
7880

79-
.tagList-item-active, .tagList-itemNarrow-active
81+
.tagList-item-active
8082
background-color $ui-button--active-backgroundColor
8183
color $ui-text-color
8284
&:hover
@@ -85,7 +87,7 @@ body[data-theme="white"]
8587
color $ui-text-color
8688

8789
body[data-theme="dark"]
88-
.tagList-item, .tagList-itemNarrow
90+
.tagList-item
8991
color $ui-dark-inactive-text-color
9092
&:hover
9193
color $ui-dark-text-color
@@ -94,7 +96,7 @@ body[data-theme="dark"]
9496
color $ui-dark-text-color
9597
background-color $ui-dark-button--active-backgroundColor
9698

97-
.tagList-item-active, .tagList-itemNarrow-active
99+
.tagList-item-active
98100
background-color $ui-dark-button--active-backgroundColor
99101
color $ui-dark-text-color
100102
&:active

0 commit comments

Comments
 (0)