Skip to content

Commit 857d1ad

Browse files
author
Cathy Siller
committed
fix(#449): add css base styles with class to positionable elements
1 parent f327bba commit 857d1ad

File tree

10 files changed

+110
-11
lines changed

10 files changed

+110
-11
lines changed

docs/components/menus/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
minver: 0.2.0
44
also:
55
components/buttons: Buttons
6+
components/menus/test.html: Testing - Menus
67
elements/hx-menu: <hx-menu>
78
elements/hx-menuitem: <hx-menuitem>
89
---

docs/components/menus/test.html

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: Testing - Menus
3+
---
4+
{% extends 'test.njk' %}
5+
{% block content %}
6+
<section>
7+
<nav class="hxBreadcrumb">
8+
<a href="components/menus">Menus</a>
9+
<hx-icon class="delimiter" type="angle-right"></hx-icon>
10+
<a href="#">{{page.title}}</a>
11+
</nav>
12+
</section>
13+
14+
<section>
15+
<header>
16+
<h2 id="menu-in-table-header">Menu Inside a Table Header</h2>
17+
</header>
18+
<table class="hxTable">
19+
<thead>
20+
<tr>
21+
<th>
22+
Table Header
23+
<hx-disclosure aria-controls="cogMenuId" class="hxBtn hxCog">
24+
<hx-icon type="cog"></hx-icon>
25+
</hx-disclosure>
26+
<hx-menu id="cogMenuId" open>
27+
<hx-menuitem>Action 1</hx-menuitem>
28+
<hx-menuitem>Action 2</hx-menuitem>
29+
<hx-menuitem>Action 3</hx-menuitem>
30+
</hx-menu>
31+
</th>
32+
</tr>
33+
</thead>
34+
</table>
35+
</section>
36+
{% endblock %}

docs/components/popovers/test.html

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,6 @@ <h2>Within Scrollable Container</h2>
372372
</hx-div>
373373
</section>
374374

375-
<hr />
376-
377375
<h2>Deprecated Markup</h2>
378376

379377
<section>
@@ -529,4 +527,33 @@ <h3>Deprecated Scrolling Content</h3>
529527
</hx-popover>
530528
</div>
531529
</section>
530+
531+
<section>
532+
<header>
533+
<h2 id="popover-in-table-header">Popover Inside a Table Header</h2>
534+
</header>
535+
<table class="hxTable">
536+
<thead>
537+
<tr>
538+
<th>
539+
Table Header
540+
<hx-disclosure aria-controls="testPopover" class="hxBtn" open>
541+
<hx-icon type="cog"></hx-icon>
542+
</hx-disclosure>
543+
<hx-popover id="testPopover" open position="right">
544+
<header>
545+
Popover Header
546+
</header>
547+
548+
<hx-div>
549+
<p>
550+
This is my popover body.
551+
</p>
552+
</hx-div>
553+
</hx-popover>
554+
</th>
555+
</tr>
556+
</thead>
557+
</table>
558+
</section>
532559
{% endblock %}

docs/components/tooltips/test.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,25 @@ <h2>Multiple Targets in Near Proximity</h2>
243243
</tbody>
244244
</table>
245245
</section>
246+
247+
<section>
248+
<header>
249+
<h2 id="tooltip-in-table-header">Tooltip Inside a Table Header</h2>
250+
</header>
251+
<table class="hxTable">
252+
<thead>
253+
<tr>
254+
<th>
255+
Rank
256+
<p>
257+
<hx-icon id="testIcon1" type="help-circle"></hx-icon>
258+
</p>
259+
<hx-tooltip for="testIcon1" open position="bottom-center">
260+
Bottom Center Tooltip
261+
</hx-tooltip>
262+
</th>
263+
</tr>
264+
</thead>
265+
</table>
266+
</section>
246267
{% endblock %}

src/helix-ui/styles/components.less

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
.hxComponent {
2+
color: @gray-900;
3+
font-family: "Roboto", sans-serif;
4+
font-size: 1rem;
5+
font-style: normal;
6+
font-weight: 400;
7+
letter-spacing: normal;
8+
line-height: 1.5;
9+
text-align: left;
10+
text-decoration: none;
11+
text-shadow: none;
12+
text-transform: none;
13+
white-space: normal;
14+
word-break: normal;
15+
word-spacing: normal;
16+
word-wrap: normal;
17+
}
18+
119
/* ========== COMPONENTS ========== *\
220
- Complex CSS Selectors
321
- NO !important

src/helix-ui/styles/components/menus.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@import (reference) 'mixins';
22
@import (reference) 'components/box';
33

4-
hx-menu {
4+
hx-menu:extend(.hxComponent) {
55
#Positionable.base();
66

77
background-color: @gray-0;

src/helix-ui/styles/components/modals.less

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@import (reference) 'vars';
22
@import (reference) 'components/layouts';
33

4-
hx-modal {
4+
hx-modal:extend(.hxComponent) {
55
display: none;
66
height: 100vh;
77
left: 0;
@@ -66,7 +66,6 @@ hx-modal {
6666
}
6767

6868
// DEPRECATED: remove in v1.0.0
69-
7069
hx-modalhead {
7170
flex-shrink: 0;
7271
order: 1;

src/helix-ui/styles/components/popovers.less

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@import (reference) 'components/layouts';
44
@import (reference) 'components/typography';
55

6-
hx-popover {
6+
hx-popover:extend(.hxComponent) {
77
#Positionable.base();
88

99
max-width: 32rem; //~512px
@@ -29,7 +29,6 @@ hx-popover {
2929
// TODO: is there any way to simplify this?
3030
#hxPopover.hx-popover, // ShadyDOM selector
3131
hx-popover {
32-
color: @gray-900;
3332
flex-direction: column;
3433

3534
&[open] {

src/helix-ui/styles/components/search.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@import (reference) 'mixins';
22

3-
hx-search-assistance {
3+
hx-search-assistance:extend(.hxComponent) {
44
#Positionable.base();
55

66
background-color: @gray-0;

src/helix-ui/styles/components/tooltips.less

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
@import (reference) 'mixins';
22

3-
hx-tooltip {
3+
hx-tooltip:extend(.hxComponent) {
44
#Positionable.base();
55

6-
color: @gray-900;
76
font-size: 0.875rem;
87
max-width: 25rem; // 400px
9-
text-align: left;
108
z-index: @tooltip-z-index;
119

1210
&[open] {

0 commit comments

Comments
 (0)