Commit 5f46b0b1 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Factorize active, hover, focus states

Drop gradient image, which can not be animated with css transition
parent 9baa6ebf
...@@ -238,6 +238,10 @@ a[href=""] { ...@@ -238,6 +238,10 @@ a[href=""] {
a:hover { a:hover {
text-decoration: underline; text-decoration: underline;
} }
a:focus {
outline-offset: -2px;
outline: 2px solid #3388cc;
}
a[accesskey]:after { a[accesskey]:after {
content: " [" attr(accesskey) "] "; content: " [" attr(accesskey) "] ";
} }
...@@ -299,7 +303,7 @@ textarea:focus { ...@@ -299,7 +303,7 @@ textarea:focus {
} }
input:not([type=submit]):not([type=file]):not([type=checkbox]):not([type=radio]):not([type=color]):focus, input:not([type=submit]):not([type=file]):not([type=checkbox]):not([type=radio]):not([type=color]):focus,
textarea:focus { textarea:focus {
box-shadow: 0 0 12px #3388cc; box-shadow: 0 0 12px #3388cc;
} }
select { select {
width: 100%; width: 100%;
...@@ -318,10 +322,8 @@ select { ...@@ -318,10 +322,8 @@ select {
outline-offset: 0; outline-offset: 0;
} }
select:hover, select:hover,
select:active, select:active {
select:focus {
background-color: #e0e0e0; background-color: #e0e0e0;
background: linear-gradient(#f5f5f5, #eeeeee);
} }
textarea { textarea {
height: 15em; height: 15em;
...@@ -350,6 +352,7 @@ button { ...@@ -350,6 +352,7 @@ button {
border: none; border: none;
background-color: #FFFFFF; background-color: #FFFFFF;
color: #1F1F1F; color: #1F1F1F;
transition: background-color 0.2s ease-out;
cursor: pointer; cursor: pointer;
} }
input[type=submit]::-moz-focus-inner, input[type=submit]::-moz-focus-inner,
...@@ -357,6 +360,17 @@ button::-moz-focus-inner { ...@@ -357,6 +360,17 @@ button::-moz-focus-inner {
border: 0px; border: 0px;
padding: 0px; padding: 0px;
} }
input[type=submit]:hover,
button:hover,
input[type=submit]:focus,
button:focus {
outline: none;
background-color: #e0e0e0;
}
input[type=submit]:active,
button:active {
background-color: #adadad;
}
/********************************************** /**********************************************
* Media * Media
**********************************************/ **********************************************/
...@@ -465,6 +479,10 @@ div[data-gadget-scope='panel'] ul li a { ...@@ -465,6 +479,10 @@ div[data-gadget-scope='panel'] ul li a {
div[data-gadget-scope='panel'] ul li a::before { div[data-gadget-scope='panel'] ul li a::before {
width: 2em; width: 2em;
} }
div[data-gadget-scope='panel'] ul li a:hover,
div[data-gadget-scope='panel'] ul li a:active {
background-color: #2b2b2b;
}
/********************************************** /**********************************************
* Gadget: editor panel * Gadget: editor panel
**********************************************/ **********************************************/
...@@ -539,18 +557,23 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -539,18 +557,23 @@ div[data-gadget-scope='header'] .ui-header {
display: flex; display: flex;
width: 100%; width: 100%;
flex-flow: row wrap; flex-flow: row wrap;
color: #FFFFFF;
} }
@media only screen and (min-width: 62em) { @media only screen and (min-width: 62em) {
div[data-gadget-scope='header'] .ui-header { div[data-gadget-scope='header'] .ui-header {
margin-left: 17em; margin-left: 17em;
} }
} }
div[data-gadget-scope='header'] .ui-header button,
div[data-gadget-scope='header'] .ui-header a {
color: #FFFFFF;
background-color: #085078;
}
div[data-gadget-scope='header'] .ui-header button:hover, div[data-gadget-scope='header'] .ui-header button:hover,
div[data-gadget-scope='header'] .ui-header a:hover, div[data-gadget-scope='header'] .ui-header a:hover,
div[data-gadget-scope='header'] .ui-header button:active, div[data-gadget-scope='header'] .ui-header button:active,
div[data-gadget-scope='header'] .ui-header a:active { div[data-gadget-scope='header'] .ui-header a:active {
background-color: #085078; background-color: #0e90d8;
background-image: linear-gradient(#0E81C2, #85D8CE);
} }
div[data-gadget-scope='header'] .ui-header > .ui-btn-left button, div[data-gadget-scope='header'] .ui-header > .ui-btn-left button,
div[data-gadget-scope='header'] .ui-header > .ui-btn-left a { div[data-gadget-scope='header'] .ui-header > .ui-btn-left a {
...@@ -560,8 +583,6 @@ div[data-gadget-scope='header'] .ui-header .ui-controlgroup-controls button, ...@@ -560,8 +583,6 @@ div[data-gadget-scope='header'] .ui-header .ui-controlgroup-controls button,
div[data-gadget-scope='header'] .ui-header .ui-controlgroup-controls a { div[data-gadget-scope='header'] .ui-header .ui-controlgroup-controls a {
display: block; display: block;
line-height: 2.6em; line-height: 2.6em;
color: #FFFFFF;
background-color: #085078;
width: 8em; width: 8em;
} }
@media only screen and (max-width: 28em) { @media only screen and (max-width: 28em) {
...@@ -613,7 +634,6 @@ div[data-gadget-scope='header'] .ui-header h1 { ...@@ -613,7 +634,6 @@ div[data-gadget-scope='header'] .ui-header h1 {
line-height: 2.6em; line-height: 2.6em;
flex: 1; flex: 1;
background-color: #085078; background-color: #085078;
color: #FFFFFF;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -628,7 +648,6 @@ div[data-gadget-scope='header'] .ui-header h1 > span { ...@@ -628,7 +648,6 @@ div[data-gadget-scope='header'] .ui-header h1 > span {
} }
div[data-gadget-scope='header'] .ui-header h1 a { div[data-gadget-scope='header'] .ui-header h1 a {
display: block; display: block;
color: #FFFFFF;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -654,6 +673,9 @@ div[data-gadget-scope='header'] .ui-header ul { ...@@ -654,6 +673,9 @@ div[data-gadget-scope='header'] .ui-header ul {
display: table; display: table;
table-layout: fixed; table-layout: fixed;
} }
div[data-gadget-scope='header'] .ui-header ul a {
background-color: #0E81C2;
}
@media only screen and (min-width: 62em) { @media only screen and (min-width: 62em) {
div[data-gadget-scope='header'] .ui-header ul { div[data-gadget-scope='header'] .ui-header ul {
height: 100%; height: 100%;
...@@ -669,7 +691,6 @@ div[data-gadget-scope='header'] .ui-header ul { ...@@ -669,7 +691,6 @@ div[data-gadget-scope='header'] .ui-header ul {
min-width: 5em; min-width: 5em;
line-height: 2.6em; line-height: 2.6em;
height: 100%; height: 100%;
color: #f8fff3;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
} }
...@@ -689,7 +710,6 @@ div[data-gadget-scope='header'] .ui-header ul { ...@@ -689,7 +710,6 @@ div[data-gadget-scope='header'] .ui-header ul {
display: block; display: block;
padding-top: 0.8em; padding-top: 0.8em;
padding-bottom: 0.8em; padding-bottom: 0.8em;
color: #f8fff3;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
} }
...@@ -756,13 +776,8 @@ div[data-gadget-scope='header'] .ui-header ul { ...@@ -756,13 +776,8 @@ div[data-gadget-scope='header'] .ui-header ul {
float: right; float: right;
} }
.gadget-content ul.document-listview li a:hover, .gadget-content ul.document-listview li a:hover,
.gadget-content ul.document-listview li a:active, .gadget-content ul.document-listview li a:active {
.gadget-content ul.document-listview li a:focus {
background-color: #e0e0e0; background-color: #e0e0e0;
background: linear-gradient(#f5f5f5, #eeeeee);
}
.gadget-content ul.document-listview li a:focus {
box-shadow: 0 0 12px #3388cc;
} }
.gadget-content ul.document-listview li:first-child { .gadget-content ul.document-listview li:first-child {
border-top-left-radius: 0.325em; border-top-left-radius: 0.325em;
...@@ -891,11 +906,11 @@ div[data-gadget-scope='erp5_searchfield'] button { ...@@ -891,11 +906,11 @@ div[data-gadget-scope='erp5_searchfield'] button {
color: #1F1F1F; color: #1F1F1F;
} }
.document_table table tbody tr:nth-child(even) { .document_table table tbody tr:nth-child(even) {
background-color: #eeeeee; background-color: #f2f2f2;
background-color: rgba(0, 0, 0, 0.04);
} }
.document_table table tbody tr:hover { .document_table table tbody tr:hover,
background: #e4ebf1; .document_table table tbody tr:active {
background-color: #e0e0e0;
} }
@media only screen and (min-width: 62em), only screen and (min-width: 28em) and (max-width: 62em) { @media only screen and (min-width: 62em), only screen and (min-width: 28em) and (max-width: 62em) {
.document_table table tbody a { .document_table table tbody a {
...@@ -939,7 +954,7 @@ div[data-gadget-scope='erp5_searchfield'] button { ...@@ -939,7 +954,7 @@ div[data-gadget-scope='erp5_searchfield'] button {
right: 0.5em; right: 0.5em;
top: 50%; top: 50%;
margin-top: -0.75em; margin-top: -0.75em;
background: #FFFFFF; background-color: #FFFFFF;
border-radius: 0.5em; border-radius: 0.5em;
width: 1em; width: 1em;
text-align: center; text-align: center;
...@@ -983,6 +998,10 @@ div[data-gadget-scope='erp5_searchfield'] button { ...@@ -983,6 +998,10 @@ div[data-gadget-scope='erp5_searchfield'] button {
.document_table table tfoot .ui-controlgroup-controls a:last-of-type { .document_table table tfoot .ui-controlgroup-controls a:last-of-type {
margin-right: 0; margin-right: 0;
} }
.document_table table tfoot .ui-controlgroup-controls a:hover,
.document_table table tfoot .ui-controlgroup-controls a:active {
background-color: #e0e0e0;
}
@media only screen and (max-width: 28em) { @media only screen and (max-width: 28em) {
.document_table table tfoot .ui-controlgroup-controls a { .document_table table tfoot .ui-controlgroup-controls a {
width: 2em; width: 2em;
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>952.27049.47586.45516</string> </value> <value> <string>952.31797.52108.19336</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1467967442.23</float> <float>1468252822.53</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
@colorsubheaderbackground: #0E81C2; @colorsubheaderbackground: #0E81C2;
@colorsubheaderlink: #f8fff3; @colorsubheaderlink: #f8fff3;
@colorfocus: #3388cc;
@colorblocklinkbackground: #e0e0e0;
@panelbackgroundcolor: #444444; @panelbackgroundcolor: #444444;
@radius: .325em; @radius: .325em;
...@@ -105,7 +108,6 @@ ...@@ -105,7 +108,6 @@
/********************************************** /**********************************************
...@@ -267,6 +269,10 @@ mark { ...@@ -267,6 +269,10 @@ mark {
&:hover { &:hover {
text-decoration: underline; text-decoration: underline;
} }
&:focus {
outline-offset: -2px;
outline: 2px @border-type @colorfocus;
}
} }
a { a {
...@@ -336,11 +342,10 @@ input:not([type=submit]):not([type=file]):not([type=checkbox]):not([type=radio]) ...@@ -336,11 +342,10 @@ input:not([type=submit]):not([type=file]):not([type=checkbox]):not([type=radio])
} }
&:active, &:focus { &:active, &:focus {
// outline: 2px @border-type @colortextboxbackground;
outline-offset: 0; outline-offset: 0;
} }
&:focus { &:focus {
box-shadow: 0 0 12px #3388cc; box-shadow: 0 0 12px @colorfocus;
} }
} }
...@@ -364,10 +369,9 @@ select { ...@@ -364,10 +369,9 @@ select {
outline-offset: 0; outline-offset: 0;
&:hover, &:active, &:focus { &:hover, &:active {
background-color: #e0e0e0; background-color: @colorblocklinkbackground;
background: linear-gradient(#f5f5f5, #eeeeee); }
}
} }
textarea { textarea {
...@@ -405,6 +409,16 @@ input[type=submit], button { ...@@ -405,6 +409,16 @@ input[type=submit], button {
background-color: @colorbackground; background-color: @colorbackground;
color: @colorforeground; color: @colorforeground;
transition: background-color 0.2s ease-out;
&:hover, &:focus {
outline: none;
background-color: @colorblocklinkbackground;
}
&:active {
// box-shadow: inset 0 0 0 5px darken(@colorblocklinkbackground, 10%);
background-color: darken(@colorblocklinkbackground, 20%);
}
cursor: pointer; cursor: pointer;
} }
...@@ -527,6 +541,9 @@ div[data-gadget-scope='panel'] { ...@@ -527,6 +541,9 @@ div[data-gadget-scope='panel'] {
&::before { &::before {
width: 2em; width: 2em;
} }
&:hover, &:active {
background-color: darken(@panelbackgroundcolor, 10%);
}
} }
} }
} }
...@@ -636,10 +653,13 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -636,10 +653,13 @@ div[data-gadget-scope='header'] .ui-header {
margin-left: @panelwidth; margin-left: @panelwidth;
} }
color: @white;
button, a { button, a {
color: @white;
background-color: @colorheaderbackground;
&:hover, &:active { &:hover, &:active {
background-color: @colorheaderbackground; background-color: lighten(@colorheaderbackground, 20%);
background-image: linear-gradient(#0E81C2, #85D8CE);
} }
} }
...@@ -656,8 +676,6 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -656,8 +676,6 @@ div[data-gadget-scope='header'] .ui-header {
display: block; display: block;
line-height: @headerheight; line-height: @headerheight;
color: @white;
background-color: @colorheaderbackground;
// https://css-tricks.com/forums/topic/hide-text-but-not-the-before-pseudo-class/ // https://css-tricks.com/forums/topic/hide-text-but-not-the-before-pseudo-class/
// Default size // Default size
...@@ -706,9 +724,8 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -706,9 +724,8 @@ div[data-gadget-scope='header'] .ui-header {
text-align: left; text-align: left;
line-height: @headerheight; line-height: @headerheight;
flex: 1; flex: 1;
background-color: @colorheaderbackground;
color: @white; background-color: @colorheaderbackground;
// XXX Restore border // XXX Restore border
// border-left: 1px solid rgba(255, 255, 255, 0.55); // border-left: 1px solid rgba(255, 255, 255, 0.55);
...@@ -729,7 +746,6 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -729,7 +746,6 @@ div[data-gadget-scope='header'] .ui-header {
// Clickable title // Clickable title
a { a {
display: block; display: block;
color: @white;
// Do not put link on multi line in case of small screen // Do not put link on multi line in case of small screen
white-space: nowrap; white-space: nowrap;
...@@ -765,6 +781,10 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -765,6 +781,10 @@ div[data-gadget-scope='header'] .ui-header {
display: table; display: table;
table-layout: fixed; table-layout: fixed;
a {
background-color: @colorsubheaderbackground;
}
@media @desktop { @media @desktop {
height: 100%; height: 100%;
...@@ -782,9 +802,6 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -782,9 +802,6 @@ div[data-gadget-scope='header'] .ui-header {
line-height: @headerheight; line-height: @headerheight;
height: 100%; height: 100%;
color: @colorsubheaderlink;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
...@@ -814,8 +831,6 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -814,8 +831,6 @@ div[data-gadget-scope='header'] .ui-header {
padding-bottom: 0.2em; padding-bottom: 0.2em;
} }
color: @colorsubheaderlink;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
...@@ -885,12 +900,8 @@ div[data-gadget-scope='header'] .ui-header { ...@@ -885,12 +900,8 @@ div[data-gadget-scope='header'] .ui-header {
text-align: right; text-align: right;
float:right; float:right;
} }
&:hover, &:active, &:focus { &:hover, &:active {
background-color: #e0e0e0; background-color: @colorblocklinkbackground;
background: linear-gradient(#f5f5f5, #eeeeee);
}
&:focus {
box-shadow: 0 0 12px #3388cc;
} }
} }
&:first-child { &:first-child {
...@@ -1046,11 +1057,10 @@ div[data-gadget-scope='erp5_searchfield'] { ...@@ -1046,11 +1057,10 @@ div[data-gadget-scope='erp5_searchfield'] {
tr { tr {
&:nth-child(even) { &:nth-child(even) {
background-color: #eeeeee; background-color: darken(@colorbackground, 5%);
background-color: rgba(0, 0, 0, .04);
} }
&:hover { &:hover, &:active {
background: #e4ebf1; background-color: @colorblocklinkbackground
} }
} }
...@@ -1099,7 +1109,7 @@ div[data-gadget-scope='erp5_searchfield'] { ...@@ -1099,7 +1109,7 @@ div[data-gadget-scope='erp5_searchfield'] {
top: 50%; top: 50%;
margin-top: -0.75em; margin-top: -0.75em;
background: @colorbackground; background-color: @colorbackground;
border-radius: 0.5em; border-radius: 0.5em;
width: 1em; width: 1em;
text-align: center; text-align: center;
...@@ -1148,6 +1158,10 @@ div[data-gadget-scope='erp5_searchfield'] { ...@@ -1148,6 +1158,10 @@ div[data-gadget-scope='erp5_searchfield'] {
margin-right: 0; margin-right: 0;
} }
&:hover, &:active {
background-color: @colorblocklinkbackground;
}
@media @smartphone { @media @smartphone {
.hide_text(@width: 2em); .hide_text(@width: 2em);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment