Skip to content

Commit 8fe61bc

Browse files
committed
adding bracket-mark component
1 parent fc258e1 commit 8fe61bc

File tree

4 files changed

+43
-46
lines changed

4 files changed

+43
-46
lines changed

app/components/bracket-mark.hbs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<span local-class='mark-wrapper'>
2+
<mark local-class="{{@color}}">{{yield}}</mark>
3+
</span>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
mark {
2+
background-color: transparent;
3+
4+
&.orange {
5+
color: hsl(39, 98%, 47%);
6+
}
7+
8+
&.yellow {
9+
color: hsl(39, 71%, 45%);
10+
}
11+
12+
&.green {
13+
color: hsl(136, 67%, 38%);
14+
}
15+
}
16+
17+
.mark-wrapper {
18+
margin: 0;
19+
word-break: break-all;
20+
21+
&:before {
22+
content: "(";
23+
margin-right: -3px;
24+
}
25+
26+
&:after {
27+
content: ")";
28+
margin-left: -3px;
29+
}
30+
}

app/components/version-list/row.hbs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,15 @@
2323
<EmberTooltip @side="right" data-test-release-track-title>
2424
{{this.releaseTrackTitle}}
2525
{{#if this.displaysReleaseTrackModifiers}}
26-
<p local-class='mark-wrapper'>
27-
{{#if @version.isPrerelease}}
28-
<mark local-class="yellow">prerelease</mark>
29-
{{/if}}
30-
{{#if this.hasAllReleaseTrackModifiers}}
31-
,
32-
{{/if}}
33-
{{#if @version.isHighestOfReleaseTrack}}
34-
<mark local-class="green">latest</mark>
35-
{{/if}}
36-
</p>
26+
{{#if @version.isPrerelease}}
27+
<BracketMark @color='yellow'>prerelease</BracketMark>
28+
{{/if}}
29+
{{#if this.hasAllReleaseTrackModifiers}}
30+
,
31+
{{/if}}
32+
{{#if @version.isHighestOfReleaseTrack}}
33+
<BracketMark @color='green'>latest</BracketMark>
34+
{{/if}}
3735
{{/if}}
3836
</EmberTooltip>
3937
</div>
@@ -72,9 +70,7 @@
7270
<EmberTooltip>
7371
{{date-format @version.created_at 'PPP'}}
7472
{{#if @version.isNew}}
75-
<p local-class='mark-wrapper'>
76-
<mark local-class="orange">recent</mark>
77-
</p>
73+
<BracketMark @color='orange'>recent</BracketMark>
7874
{{/if}}
7975
</EmberTooltip>
8076
</time>

app/components/version-list/row.module.css

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -190,38 +190,6 @@
190190
}
191191
}
192192

193-
mark{
194-
background-color: transparent;
195-
196-
&.orange{
197-
color: hsl(39, 98%, 47%);
198-
}
199-
200-
&.yellow{
201-
color: hsl(39, 71%, 45%);
202-
}
203-
204-
&.green{
205-
color: hsl(136, 67%, 38%);
206-
}
207-
}
208-
209-
.mark-wrapper{
210-
display: inline;
211-
margin: 0;
212-
word-break: break-all;
213-
214-
&:before{
215-
content: "(";
216-
margin-right: -3px;
217-
}
218-
219-
&:after{
220-
content: ")";
221-
margin-left: -3px;
222-
}
223-
}
224-
225193
.msrv {
226194
text-transform: initial;
227195

0 commit comments

Comments
 (0)