Skip to content

Commit abfeb5d

Browse files
authored
fix(popover): update popover design (#298)
* fix(popover): fix popover shadow #287 * fix(popover): update popover background and font, add separator
1 parent 78ddb88 commit abfeb5d

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

lib/popover/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ class Popover extends React.Component {
108108
tabIndex={0}
109109
>
110110
{title && <span className={theme.title} aria-label="popover-title">{title}</span>}
111+
{ title && <hr /> }
111112
<div className={classnames(theme.popoverContent)}>{content}</div>
112113
{!noAction && this.renderActionContent()}
113114
<span className={theme.popoverArrow} />

lib/popover/tests/accessibility.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ describe('Popover accessibility tests', () => {
7575
.props
7676
.children;
7777
simulateEvent(Button, 'click');
78-
expect(actualValue()[2].props['aria-label']).to.equal(expectedValueBefore);
78+
expect(actualValue()[3].props['aria-label']).to.equal(expectedValueBefore);
7979
wrappedComponent.setProps({ noAction: true });
80-
expect(actualValue()[2]).to.equal(expectedValueAfter);
80+
expect(actualValue()[3]).to.equal(expectedValueAfter);
8181
});
8282

8383
it('Should not render title when title prop is not passed', () => {

lib/popover/theme.module.scss

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
}
88

99
:local(.popoverWrapper) {
10+
filter: drop-shadow(1px 1px 3px rgba(0, 0, 0, 0.3));
1011
margin: 2% 1%;
1112
padding: 10px;
1213
/*
@@ -21,16 +22,28 @@
2122
white-space: nowrap;
2223
max-width: 100px;
2324
border-radius: 5px;
24-
background-color: $secondary-white;
25+
background-color: #ffffff;
2526
position: absolute;
26-
box-shadow: 1px 0px 8px 1px rgba(0, 0, 0, 0.3);
2727
outline: none;
28+
font-size: 0.9em;
2829
z-index: 999; // render on top of any content
30+
font-variant-ligatures: none;
31+
-webkit-font-variant-ligatures: none;
32+
text-rendering: optimizeLegibility;
33+
-moz-osx-font-smoothing: grayscale;
34+
font-smooth: antialiased;
35+
-webkit-font-smoothing: antialiased;
36+
text-shadow: rgba(0, 0, 0, .01) 0 0 1px;
37+
hr {
38+
width: 100%;
39+
height: 1px;
40+
background-color: rgba(0, 0, 0, 0.3);
41+
border: none;
42+
}
2943
}
3044

3145
:local(.title) {
3246
display: inline-block;
33-
font-size: 18px;
3447
font-weight: bold;
3548
text-transform: capitalize;
3649
margin-bottom: 10px;
@@ -57,7 +70,7 @@
5770
display: inline-block;
5871
min-width: 12px;
5972
min-height: 12px;
60-
background-color: $secondary-white;
73+
background-color: #ffffff;
6174
}
6275

6376
/* top positions */

0 commit comments

Comments
 (0)