diff options
author | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-03 17:22:15 +0000 |
---|---|---|
committer | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-03 17:22:15 +0000 |
commit | 9a30588cd1081b702ade98be4eb4a7c1344bb43e (patch) | |
tree | 7b2d1b7eae4ea9c6f4117a2a5d20590ec6e9cf33 /chrome/browser/resources/bookmark_manager/css | |
parent | 5e90f82f1121ec44022d60f3645c8105cc8a6271 (diff) | |
download | chromium_src-9a30588cd1081b702ade98be4eb4a7c1344bb43e.zip chromium_src-9a30588cd1081b702ade98be4eb4a7c1344bb43e.tar.gz chromium_src-9a30588cd1081b702ade98be4eb4a7c1344bb43e.tar.bz2 |
Move bookmark manager
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/560023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37980 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/bookmark_manager/css')
4 files changed, 329 insertions, 0 deletions
diff --git a/chrome/browser/resources/bookmark_manager/css/list.css b/chrome/browser/resources/bookmark_manager/css/list.css new file mode 100644 index 0000000..0170566 --- /dev/null +++ b/chrome/browser/resources/bookmark_manager/css/list.css @@ -0,0 +1,61 @@ + +list { + overflow: auto; + outline: none; +} + +list > * { + font: 11px verdana; + -webkit-user-select: none; + border: 1px solid rgba(255,255,255,0); /* transparent white */ + background-color: rgba(255,255,255,0); + -webkit-border-radius: 2px; + padding: 0px 3px; + line-height: 20px; + white-space: nowrap; + cursor: default; + -webkit-transition: all .12s; + position: relative; /* to allow overlap */ + display: block; +} + +list > [lead] { + border-color: transparent; +} + +list:focus > [lead] { + border-color: hsl(214, 91%, 65%); + z-index: 2; +} + +list > [anchor] { + +} + +list > :hover { + border-color: hsl(214, 91%, 85%); + z-index: 1; + background-color: hsl(214,91%,97%); +} + +list > :hover, +list > [selected] { + background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(255,255,255,0.8)), to(rgba(255,255,255,0))); +} + +list > [selected] { + border-color: hsl(0,0%,85%); + background-color: hsl(0,0%,90%); + z-index: 2; +} + +list:focus > [selected] { + background-color: hsl(214,91%,89%); + border-color: hsl(214, 91%, 65%); +} + +list:focus > [lead][selected], +list > [selected]:hover { + background-color: hsl(214,91%,87%); + border-color: hsl(214, 91%, 65%); +} diff --git a/chrome/browser/resources/bookmark_manager/css/menu.css b/chrome/browser/resources/bookmark_manager/css/menu.css new file mode 100644 index 0000000..3fe0261 --- /dev/null +++ b/chrome/browser/resources/bookmark_manager/css/menu.css @@ -0,0 +1,48 @@ + +menu { + display: none; + position: absolute; + border: 1px solid #999; + -webkit-box-shadow: 2px 2px 3px hsla(0, 0%, 0%, .3); + color: black; + background-color: hsla(213, 0%, 100%, .95); + left: 0; + white-space: nowrap; + z-index: 2; + padding: 1px; + margin: 0; + cursor: default; +} + +menu > * { + display: block; + margin: 0; + width: 100%; + text-align: start; +} + +menu > :not(hr) { + -webkit-appearance: none; + background: transparent; + font: inherit; + border: 0; + + padding: 3px 8px; + overflow: hidden; + text-overflow: ellipsis; +} + +menu > hr { + border: 0; + border-top: 1px solid rgb(153, 153, 153); + margin: 2px 0; +} + +menu > [hidden] { + display: none; +} + +menu > [selected] { + background-color: hsl(213, 66%, 57%); + color: white; +} diff --git a/chrome/browser/resources/bookmark_manager/css/tree.css b/chrome/browser/resources/bookmark_manager/css/tree.css new file mode 100644 index 0000000..66bdaf3 --- /dev/null +++ b/chrome/browser/resources/bookmark_manager/css/tree.css @@ -0,0 +1,143 @@ +tree { + outline: none; + overflow: auto; + display: block; +} + +.tree-item > .tree-row { + color: black; + font: 11px verdana; + -webkit-user-select: none; + border: 1px solid rgba(255,255,255,0); /* transparent white */ + background-color: rgba(255,255,255,0); + -webkit-border-radius: 2px; + padding: 0px 3px; + /*margin-bottom:-1px;*/ + line-height: 20px; + white-space: nowrap; + cursor: default; + /*-webkit-transition: all .12s;*/ + position: relative; +} + +.expand-icon { + width: 11px; + height: 16px; + display: inline-block; + vertical-align: top; + position: relative; + top: 2px; + background-image: -webkit-canvas(triangle-empty); + background-position: 50% 50%; + background-repeat: no-repeat; + -webkit-transition: all .15s, opacity 1.5s; + opacity: 0; +} + +html[dir=rtl] .expand-icon { + -webkit-transform: scale(-1, 1); +} + +tree:hover .expand-icon, +tree:focus .expand-icon { + opacity: 1; + -webkit-transition: all .15s, opacity .5s; +} + +.tree-item[expanded] > .tree-row > .expand-icon { + background-image: -webkit-canvas(triangle-filled); + -webkit-transform: translate(0, 3px) rotate(45deg); +} + +html[dir=rtl] .tree-item[expanded] > .tree-row > .expand-icon { + -webkit-transform: scale(-1, 1) translate(0, 3px) rotate(45deg); /* flip */ +} + +.tree-item > .tree-row > .expand-icon:hover { + background-image: -webkit-canvas(triangle-hover); +} + +.tree-row .expand-icon { + visibility: hidden; +} + +.tree-row[may-have-children] .expand-icon { + visibility: visible; +} + +.tree-row[has-children=false] .expand-icon { + visibility: hidden; +} + +.tree-item > .tree-row:hover { + border-color: hsl(214, 91%, 85%); + z-index: 1; + background-color: hsl(214, 91%, 97%); +} + +/* + WebKit has a bug with attribute selectors so we apply selected to the tree row + as well. + + https://bugs.webkit.org/show_bug.cgi?id=12519 + +*/ +.tree-row[selected]:hover, +.tree-row[selected] { + background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(255,255,255,0.8)), to(rgba(255,255,255,0))); +} + +.tree-row[selected] { + border-color: hsl(0,0%,85%); + background-color: hsl(0, 0%, 90%); + z-index: 2; +} + +:focus .tree-row[selected] { + background-color: hsl(214, 91%, 89%); + border-color: #7da2ce; +} + +.tree-children[expanded] { + display: block; +} + +.tree-children { + display: none; +} + +.tree-item > .tree-row > * { + display: inline-block; + -webkit-box-sizing: border-box; +} + +.tree-label { + -webkit-padding-start: 20px; + background-repeat: no-repeat; + background-position: 0 50%; + background-image: url("../images/folder_closed.png"); +} + +.tree-rename > .tree-row > .tree-label { + -webkit-user-select: auto; + -webkit-user-modify: read-write-plaintext-only; + background: white; + color: black; + outline: 1px solid black; +} + +html[dir=rtl] .tree-label { + background-position: 100% 50%; +} + +.tree-row[selected] > .tree-label { + background-image: url("../images/folder_open.png"); +} + +html[dir='rtl'] .tree-label { + background-image: url("../images/folder_closed_rtl.png"); +} + +html[dir='rtl'] .tree-row[selected] > .tree-label { + background-image: url("../images/folder_open_rtl.png"); +} diff --git a/chrome/browser/resources/bookmark_manager/css/tree.css.js b/chrome/browser/resources/bookmark_manager/css/tree.css.js new file mode 100644 index 0000000..34cdf8c --- /dev/null +++ b/chrome/browser/resources/bookmark_manager/css/tree.css.js @@ -0,0 +1,77 @@ + + +(function() { + var a = 7; + var a2 = a / 2; + var ctx = document.getCSSCanvasContext('2d', 'triangle-filled', a2 + 2, a + 1); + + ctx.fillStyle = '#000'; + ctx.translate(.5, .5); + ctx.beginPath(); + ctx.moveTo(0, 0); + ctx.lineTo(0, a); + ctx.lineTo(a2, a2); + ctx.closePath(); + ctx.fill(); + ctx.stroke(); + + var ctx = document.getCSSCanvasContext('2d', 'triangle-empty', a2 + 2, a + 1); + + ctx.strokeStyle = '#999'; + ctx.lineWidth = 1.2; + ctx.translate(.5, .5); + ctx.fillStyle = '#000'; + ctx.beginPath(); + + + ctx.moveTo(0, 0); + ctx.lineTo(0, a); + ctx.lineTo(a2, a2); + ctx.closePath(); + ctx.stroke(); + + var ctx = document.getCSSCanvasContext('2d', 'triangle-hover', a2 + 2 + 4, a + 1 + 4); + + ctx.shadowColor = 'hsl(214,91%,89%)' + ctx.shadowBlur = 3; + ctx.shadowOffsetX = 1; + ctx.shadowOffsetY = 0; + + ctx.strokeStyle = 'hsl(214,91%,79%)'; + ctx.lineWidth = 1.2; + ctx.translate(.5 + 2, .5 + 2); + ctx.fillStyle = '#000'; + ctx.beginPath(); + + ctx.moveTo(0, 0); + ctx.lineTo(0, a); + ctx.lineTo(a2, a2); + ctx.closePath(); + ctx.stroke(); +})(); + +// We need to generate CSS for the indentation. +(function() { + // We need to generat the following + //.tree-item > * > .tree-item > .tree-row { + // -webkit-padding-start: 20px; + //} + + //.tree-item > * .tree-item > * .tree-item > * > .tree-item > .tree-row { + // -webkit-padding-start: 60px; + //} + var style = document.createElement('style'); + + function repeat(s, n) { + return Array(n + 1).join(s); + } + + var s = ''; + for (var i = 1; i < 10; i++) { + s += repeat('.tree-item > * ', i) + '.tree-item > .tree-row {\n' + + '-webkit-padding-start:' + i * 20 + 'px\n' + + '}\n'; + } + style.textContent = s; + document.documentElement.firstElementChild.appendChild(style); +})(); |