Skip to content

Commit c334795

Browse files
authored
Merge pull request #398 from rackerlabs/refactor-hx-alert-shadow-css
Refactor hx alert shadow css
2 parents 3747d08 + a6d9e3c commit c334795

File tree

7 files changed

+57
-59
lines changed

7 files changed

+57
-59
lines changed

docs/components/box/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ <h2 id="spacing">Spacing</h2>
153153

154154
<section>
155155
<h2 id="scrolling-containers">Scrolling Containers</h2>
156-
<hx-alert static type="warning">
156+
<hx-alert type="warning" persist>
157157
Scrolling containers must be implemented using the
158158
<code>&lt;hx-div&gt;</code> element in order to reliably calculate
159159
coordinates of absolutely positioned elements.

docs/components/breadcrumbs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
---
55
{% extends 'component.njk' %}
66
{% block content %}
7-
<hx-alert type="warning" status="WARNING" static>
7+
<hx-alert type="warning" status="WARNING" persist>
88
The last breadcrumb hyperlink is styled to prevent mouse clicks, but it will not prevent keyboard activation.
99
</hx-alert>
1010

docs/components/grid/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{% extends 'component.njk' %}
99
{% block content %}
1010
<section>
11-
<hx-alert type="warning" status="warning" static>
11+
<hx-alert type="warning" status="warning" persist>
1212
HelixUI grid classes are not compatible with Bootstrap grid styles.
1313
</hx-alert>
1414

@@ -246,7 +246,7 @@ <h2 id="column-offset">Column Offset</h2>
246246

247247
<section><!-- column ordering -->
248248
<h2 id="column-ordering">Column Ordering</h2>
249-
<hx-alert type="info" status="fyi" static>
249+
<hx-alert type="info" status="fyi" persist>
250250
Reordering columns does not change tab order.<br />
251251
Tab order is based on the DOM order, not visual appearance.
252252
</hx-alert>
@@ -390,7 +390,7 @@ <h2 id="responsive-options">Responsive Options</h2>
390390

391391
<section><!-- column wrapping -->
392392
<h2 id="column-wrapping">Column Wrapping</h2>
393-
<hx-alert type="info" status="note" static>
393+
<hx-alert type="info" status="note" persist>
394394
Columns wrap if the total column width count within the row exceeds 12.
395395
</hx-alert>
396396
<p>
@@ -440,7 +440,7 @@ <h2 id="column-wrapping">Column Wrapping</h2>
440440

441441
<section><!-- nesting containers -->
442442
<h2 id="nesting-containers">Nesting Containers</h2>
443-
<hx-alert type="warning" status="warning" static>
443+
<hx-alert type="warning" status="warning" persist>
444444
Do not apply row and column container classes to the same element.
445445
</hx-alert>
446446
<p>You can nest rows and columns as deep as necessary.</p>
@@ -497,7 +497,7 @@ <h2 id="nesting-containers">Nesting Containers</h2>
497497

498498
<section><!-- styling containers -->
499499
<h2 id="styling-containers">Styling Containers</h2>
500-
<hx-alert type="warning" status="warning" static>
500+
<hx-alert type="warning" status="warning" persist>
501501
Do not attempt to style rows or columns directly.
502502
</hx-alert>
503503
<ul class="hxList">

docs/components/stepper/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
---
88
{% extends 'component.njk' %}
99
{% block content %}
10-
<hx-alert type="warning" status="BETA" static>
10+
<hx-alert type="warning" status="BETA" persist>
1111
This component is not recommended for production use.
1212
</hx-alert>
1313
<section>

docs/components/toasts/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{% extends 'component.njk' %}
88
{% block content %}
99
<section>
10-
<hx-alert type="info" status="note" static>
10+
<hx-alert type="info" status="note" persist>
1111
Currently, only CTA and dismiss functionality of the toast itself has been
1212
implemented. Positioning, stacking, animation, etc. functionality will be coming soon.
1313
</hx-alert>

docs/components/typography/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@ <h2 id="links">Links</h2>
196196
<p>
197197
Links should be used to refer a user to a resource or location.
198198
</p>
199-
<hx-alert static type="info" status="note">
199+
<hx-alert type="info" status="note" persist>
200200
Buttons are better suited to initiate in-page actions.
201201
</hx-alert>
202-
<hx-alert static type="warning" status="warning">
202+
<hx-alert type="warning" status="warning" persist>
203203
Adding the <code>disabled</code> attribute to a link <b>will not</b>
204204
prevent user interaction. Consider using a <code>&lt;button&gt;</code>
205205
instead.

src/helix-ui/elements/HXAlertElement.less

Lines changed: 46 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,68 +2,66 @@
22

33
#hxAlert {
44
display: flex;
5+
}
56

6-
button {
7-
align-self: flex-start;
8-
background-color: transparent;
9-
border: 0;
10-
cursor: pointer;
11-
}
7+
button {
8+
align-self: flex-start;
9+
background-color: transparent;
10+
border: 0;
11+
cursor: pointer;
12+
}
1213

13-
#hxIconWrapper {
14-
flex-shrink: 0;
15-
padding: 1rem;
16-
}
14+
#hxIconWrapper {
15+
flex-shrink: 0;
16+
padding: 1rem;
17+
}
1718

18-
#hxContent {
19-
flex-grow: 1;
20-
margin-right: 1rem;
21-
padding: 1rem 0;
22-
}
19+
#hxContent {
20+
flex-grow: 1;
21+
margin-right: 1rem;
22+
padding: 1rem 0;
23+
}
2324

24-
#hxStatus {
25-
float: left;
26-
font-weight: 500;
27-
margin-right: 0.25rem;
28-
text-transform: uppercase;
25+
#hxStatus {
26+
float: left;
27+
font-weight: 500;
28+
margin-right: 0.25rem;
29+
text-transform: uppercase;
2930

30-
&:after {
31-
content: ":";
32-
}
31+
&:after {
32+
content: ":";
33+
}
3334

34-
&:empty {
35-
display: none;
36-
}
35+
&:empty {
36+
display: none;
3737
}
38+
}
3839

39-
#hxCta {
40-
flex-shrink: 0;
41-
font-weight: 500;
42-
padding: 1rem 0;
43-
text-transform: uppercase;
44-
white-space: nowrap;
40+
#hxCta {
41+
flex-shrink: 0;
42+
font-weight: 500;
43+
padding: 1rem 0;
44+
text-transform: uppercase;
45+
white-space: nowrap;
4546

46-
&:empty {
47-
display: none;
48-
}
47+
&:empty {
48+
display: none;
4949
}
50+
}
5051

51-
#hxDismiss {
52-
flex-shrink: 0;
53-
height: 3rem;
54-
padding: 1rem;
55-
width: 3rem;
56-
}
52+
#hxDismiss {
53+
flex-shrink: 0;
54+
height: 3rem;
55+
padding: 1rem;
56+
width: 3rem;
5757
}
5858

5959
:host([persist]) {
60-
#hxAlert {
61-
#hxDismiss {
62-
display: none;
63-
}
60+
#hxDismiss {
61+
display: none;
62+
}
6463

65-
#hxCta {
66-
margin-right: 1rem;
67-
}
64+
#hxCta {
65+
margin-right: 1rem;
6866
}
6967
}

0 commit comments

Comments
 (0)