Merge "Introduce vars for styling header and dropdowns"

This commit is contained in:
Kasper Nilsson
2018-04-19 08:21:34 +00:00
committed by Gerrit Code Review
6 changed files with 47 additions and 17 deletions

View File

@@ -27,6 +27,12 @@ limitations under the License.
<style include="shared-styles"> <style include="shared-styles">
gr-dropdown { gr-dropdown {
padding: .5em; padding: .5em;
--gr-button: {
color: var(--header-text-color);
}
--gr-dropdown-item: {
color: var(--header-text-color);
}
} }
gr-avatar { gr-avatar {
height: 2em; height: 2em;

View File

@@ -35,7 +35,7 @@ limitations under the License.
display: flex; display: flex;
} }
.bigTitle { .bigTitle {
color: var(--primary-text-color); color: var(--header-text-color);
font-size: 1.75rem; font-size: 1.75rem;
text-decoration: none; text-decoration: none;
} }
@@ -68,7 +68,7 @@ limitations under the License.
position: relative; position: relative;
} }
.linksTitle { .linksTitle {
color: var(--primary-text-color); color: var(--header-text-color);
display: inline-block; display: inline-block;
font-family: var(--font-family-bold); font-family: var(--font-family-bold);
position: relative; position: relative;
@@ -95,7 +95,13 @@ limitations under the License.
.browse { .browse {
padding: .6em .5em; padding: .6em .5em;
} }
gr-dropdown {
--gr-dropdown-item: {
color: var(--header-text-color);
}
}
.browse { .browse {
color: var(--header-text-color);
/* Same as gr-button */ /* Same as gr-button */
margin: 5px 4px; margin: 5px 4px;
text-decoration: none; text-decoration: none;
@@ -115,6 +121,7 @@ limitations under the License.
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.loginButton { .loginButton {
color: var(--header-text-color);
padding: 1em; padding: 1em;
} }
.dropdown-trigger { .dropdown-trigger {

View File

@@ -36,17 +36,24 @@ limitations under the License.
list-style: none; list-style: none;
} }
li { li {
border-bottom: 1px solid var(--border-color);
cursor: pointer; cursor: pointer;
padding: .5em .75em; padding: .5em .75em;
} }
li:last-of-type {
border: none;
}
li:focus { li:focus {
outline: none; outline: none;
} }
li:hover {
background-color: var(--hover-background-color);
}
li.selected { li.selected {
background-color: #eee; background-color: var(--selection-background-color);
} }
.dropdown-content { .dropdown-content {
background: var(--view-background-color); background: var(--dropdown-background-color);
box-shadow: rgba(0, 0, 0, 0.3) 0 1px 3px; box-shadow: rgba(0, 0, 0, 0.3) 0 1px 3px;
} }
</style> </style>

View File

@@ -43,7 +43,7 @@ limitations under the License.
padding: 0; padding: 0;
} }
.dropdown-content { .dropdown-content {
background-color: var(--view-background-color); background-color: var(--dropdown-background-color);
box-shadow: 0 1px 5px rgba(0, 0, 0, .3); box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
max-height: 70vh; max-height: 70vh;
margin-top: 2em; margin-top: 2em;
@@ -63,16 +63,16 @@ limitations under the License.
min-height: 0; min-height: 0;
padding: 10px 16px; padding: 10px 16px;
} }
--paper-item-selected: {
background-color: rgba(161,194,250,.12);
}
--paper-item-focused-before: { --paper-item-focused-before: {
background-color: #f2f2f2; background-color: var(--selection-background-color);
} }
--paper-item-focused: { --paper-item-focused: {
background-color: #f2f2f2; background-color: var(--selection-background-color);
} }
} }
paper-item:hover {
background-color: var(--hover-background-color);
}
paper-item:not(:last-of-type) { paper-item:not(:last-of-type) {
border-bottom: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
} }

View File

@@ -36,7 +36,7 @@ limitations under the License.
width: 100%; width: 100%;
} }
.dropdown-content { .dropdown-content {
background-color: var(--view-background-color); background-color: var(--dropdown-background-color);
box-shadow: 0 1px 5px rgba(0, 0, 0, .3); box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
} }
gr-button { gr-button {
@@ -53,10 +53,13 @@ limitations under the License.
ul { ul {
list-style: none; list-style: none;
} }
ul .accountName { .topContent,
font-family: var(--font-family-bold); li {
border-bottom: 1px solid var(--border-color);
}
li:last-of-type {
border: none;
} }
li .accountInfo,
li .itemAction { li .itemAction {
cursor: pointer; cursor: pointer;
display: block; display: block;
@@ -74,17 +77,21 @@ limitations under the License.
text-decoration: none; text-decoration: none;
} }
li .itemAction:not(.disabled):hover { li .itemAction:not(.disabled):hover {
background-color: #6B82D6; background-color: var(--hover-background-color);
color: var(--view-background-color);
} }
li:focus, li:focus,
li.selected { li.selected {
background-color: #EBF5FB; background-color: var(--selection-background-color);
outline: none; outline: none;
} }
li:focus .itemAction,
li.selected .itemAction {
background-color: transparent;
}
.topContent { .topContent {
display: block; display: block;
padding: .85em 1em; padding: .85em 1em;
@apply --gr-dropdown-item;
} }
.bold-text { .bold-text {
font-family: var(--font-family-bold); font-family: var(--font-family-bold);

View File

@@ -22,6 +22,7 @@ limitations under the License.
--header-title-content: 'Gerrit'; --header-title-content: 'Gerrit';
--header-icon: none; --header-icon: none;
--header-icon-size: 0em; --header-icon-size: 0em;
--header-text-color: #000;
--footer-background-color: var(--header-background-color); --footer-background-color: var(--header-background-color);
--border-color: #ddd; --border-color: #ddd;
@@ -40,6 +41,8 @@ limitations under the License.
--table-header-background-color: #fafafa; --table-header-background-color: #fafafa;
--table-subheader-background-color: #eaeaea; --table-subheader-background-color: #eaeaea;
--dropdown-background-color: #fff;
/* Font sizes */ /* Font sizes */
--font-size-normal: 1rem; --font-size-normal: 1rem;
--font-size-small: .92rem; --font-size-small: .92rem;