Skip to content

Commit 5c80321

Browse files
committed
improve selection toolbar customization
1 parent cd17476 commit 5c80321

1 file changed

Lines changed: 33 additions & 24 deletions

File tree

‎mostly-selection/mostly-selection-toolbar.html‎

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@
77
<link rel="import" href="../widgets/mostly-dialog.html">
88

99
<!--
10+
### Styling
11+
12+
The following custom properties and mixins are available for styling:
13+
14+
Custom property | Description | Default
15+
----------------------------------------|------------------------------------|-----------------------
16+
`--mostly-selection-toolbar-background` | Background color | #000
17+
`--mostly-selection-toolbar-text` | Text color | #fff
18+
`--mostly-selection-toolbar-link` | Link color | #fff
19+
`--mostly-selection-toolbar-link-hover` | Link hover color | #000
20+
`--mostly-selection-toolbar` | Mixin applied to the toolbar | `{}`
21+
22+
1023
`mostly-selection-toolbar`
1124
@group Mostly UI
1225
@element mostly-selection-toolbar
@@ -29,11 +42,12 @@
2942
left: 0;
3043
right: 0;
3144
z-index: 201;
32-
background: var(--mostly-toolbar);
3345
padding: 0 2em;
3446
font-weight: 300;
35-
color: #fff;
3647
box-shadow: 0 0 3px rgba(0,0,0,0.4);
48+
background: var(--mostly-selection-toolbar-background, #000);
49+
color: var(--mostly-selection-toolbar-text, #fff);
50+
@apply --mostly-selection-toolbar;
3751
}
3852

3953
.actions {
@@ -43,29 +57,10 @@
4357
@apply --layout-end-justified;
4458
}
4559

46-
@media (min-width: 1280px) {
47-
.toolbar {
48-
padding-left: 4.5rem;
49-
}
50-
}
51-
5260
.count {
5361
font-weight: 600;
5462
}
5563

56-
a.selectionLink {
57-
display: inline-block;
58-
vertical-align: bottom;
59-
text-decoration: underline;
60-
margin-left: 1em;
61-
color: #fff;
62-
}
63-
64-
a.selectionLink:hover {
65-
cursor: pointer;
66-
color: var(--mostly-link-hover-color);
67-
}
68-
6964
#selectedItemsPopup {
7065
margin-top: 196px;
7166
}
@@ -74,6 +69,20 @@
7469
@apply --layout-flex;
7570
@apply --layout-horizontal;
7671
}
72+
73+
/* links */
74+
a, a:active, a:visited, a:focus {
75+
display: inline-block;
76+
vertical-align: bottom;
77+
text-decoration: underline;
78+
margin-left: 1em;
79+
color: var(--mostly-selection-toolbar-link, #fff);
80+
cursor: pointer;
81+
}
82+
83+
a:hover {
84+
color: var(--mostly-selection-toolbar-link-hover, #000);
85+
}
7786
</style>
7887

7988
<div class="horizontal center layout" id="content">
@@ -83,13 +92,13 @@
8392
<a class="selectionLink" on-tap="toogleSelectedItemsPopup">
8493
<span>[[i18n('selectionToolbar.display.selection')]]</span>
8594
</a>
86-
</div>
87-
<div class="actions">
88-
<slot></slot>
8995
<a class="selectionLink" on-tap="clearSelection">
9096
<span>[[i18n('command.clear')]]</span>
9197
</a>
9298
</div>
99+
<div class="actions">
100+
<slot></slot>
101+
</div>
93102
</div>
94103
</div>
95104

0 commit comments

Comments
 (0)