Commit 179831b8 authored by rsadam@chromium.org's avatar rsadam@chromium.org

Refactor CSS rules for the shift-key.

BUG=357714

Review URL: https://codereview.chromium.org/216183005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260470 0039d316-1c4b-4281-b951-d872f2087c98
parent baec87fb
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
margin: auto; margin: auto;
position: absolute; position: absolute;
right: 0; right: 0;
text-align: center;
top: 0; top: 0;
} }
......
...@@ -9,64 +9,31 @@ ...@@ -9,64 +9,31 @@
extends="kb-key"> extends="kb-key">
<template> <template>
<style> <style>
:host() { .shift-light-wrapper {
border-radius: 2px; bottom: 3px;
border-style: solid; height: 10%;
border-width: 1px 0; margin: 0;
color: #ffffff; padding: 0;
font-family: roboto-bold; position: absolute;
font-weight: 300; width: 100%;
} }
:host(.active) { .shift-light {
-webkit-box-shadow: inset 0 1px #969696, inset 0 -1px #6f6f6f; -webkit-box-shadow: inset 0 1px #101010, inset 0 -1px #444444;
background-image: -webkit-linear-gradient(#8b8b8b, #7d7d7d); background-image: -webkit-linear-gradient(#101010, #000000);
background-size: cover; border: solid;
border-bottom-color: #5b5b5b; border-bottom-color: #1d1d1d;
border-top-color: #a4a4a4; border-top-color: #2d2d2d;
} border-width: 1px 0;
height: 0.3em;
:host() .key { margin: 0 auto;
background-image: none; position: relative;
background-position: center; width: 1.8em;
background-repeat: no-repeat; }
background-size: contain; </style>
bottom: 0;
font-size: 70%;
height: 70%;
left: 0;
margin: auto;
position: absolute;
right: 0;
top: 0;
width: auto;
}
:host() .shift-light-wrapper {
bottom: 3px;
height: 10%;
margin: 0;
padding: 0;
position: absolute;
width: 100%;
}
:host() .shift-light {
-webkit-box-shadow: inset 0 1px #101010, inset 0 -1px #444444;
background-image: -webkit-linear-gradient(#101010, #000000);
border: solid;
border-bottom-color: #1d1d1d;
border-top-color: #2d2d2d;
border-width: 1px 0;
height: 0.3em;
margin: 0 auto;
position: relative;
width: 1.8em;
}
</style>
<div id="key" class="key"> </div>
<div class="shift-light-wrapper"> <div class="shift-light-wrapper">
<div class="shift-light"> </div> <div class="shift-light"> </div>
</div> </div>
<shadow></shadow>
</template> </template>
</polymer-element> </polymer-element>
...@@ -18,18 +18,18 @@ kb-keyboard.alt-active kb-modifier-key[char=Alt] { ...@@ -18,18 +18,18 @@ kb-keyboard.alt-active kb-modifier-key[char=Alt] {
color: lightblue; color: lightblue;
} }
kb-keyboard[keyset="upper"] kb-shift-key.dark /shadow-deep/ .key { kb-keyboard[keyset="upper"] kb-shift-key.dark /deep/ .key {
background-image: url('images/shift-filled.svg'); background-image: url('images/shift-filled.svg');
} }
kb-keyboard[keyset="lower"] kb-shift-key /shadow-deep/ .key { kb-keyboard[keyset="lower"] kb-shift-key /deep/ .key{
background-image: url('images/shift.svg'); background-image: url('images/shift.svg');
} }
/** /**
* Controls whether the shift key should be highlighted or not. * Controls whether the shift key should be highlighted or not.
*/ */
kb-keyboard.caps-locked kb-shift-key.dark /shadow-deep/ kb-keyboard.caps-locked kb-shift-key.dark /deep/
.shift-light { .shift-light {
-webkit-box-shadow: 0 1px 1px rgba(213, 213, 213, 0.5), -webkit-box-shadow: 0 1px 1px rgba(213, 213, 213, 0.5),
0 -1px 1px rgba(213, 213, 213, 0.5); 0 -1px 1px rgba(213, 213, 213, 0.5);
...@@ -37,7 +37,7 @@ kb-keyboard.caps-locked kb-shift-key.dark /shadow-deep/ ...@@ -37,7 +37,7 @@ kb-keyboard.caps-locked kb-shift-key.dark /shadow-deep/
border: none; border: none;
height: 0.2em; height: 0.2em;
} }
kb-keyboard.caps-locked kb-shift-key.dark /shadow-deep/ kb-keyboard.caps-locked kb-shift-key.dark /deep/
.shift-light-wrapper { .shift-light-wrapper {
bottom: 2px; bottom: 2px;
} }
...@@ -72,15 +72,15 @@ kb-row:nth-child(n+3) kb-key:not(.dark):not(.active){ ...@@ -72,15 +72,15 @@ kb-row:nth-child(n+3) kb-key:not(.dark):not(.active){
border-top-color: #717171; border-top-color: #717171;
} }
kb-row:nth-child(2) kb-key:not([invert]) /shadow-deep/ .hint { kb-row:nth-child(2) kb-key:not([invert]) /deep/ .hint {
color: #2C2C2C; color: #2C2C2C;
} }
kb-row:nth-child(3) kb-key:not([invert]) /shadow-deep/ .hint { kb-row:nth-child(3) kb-key:not([invert]) /deep/ .hint {
color: #272727; color: #272727;
} }
kb-row:nth-child(n+3) kb-key:not([invert]) /shadow-deep/ .hint { kb-row:nth-child(n+3) kb-key:not([invert]) /deep/ .hint {
color: #232323; color: #232323;
} }
......
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