browser/metro/theme/tiles.css

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 /* Tile grid ------------------------------------------------------------- */
michael@0 6
michael@0 7 %filter substitution
michael@0 8 %include defines.inc
michael@0 9
michael@0 10 /*
michael@0 11 *****************************************************
michael@0 12 The following rules define the key tile dimensions
michael@0 13 They are (also) snarfed via the CSSOM as the dimensions used in the #richgrid binding
michael@0 14 *****************************************************
michael@0 15 */
michael@0 16 richgriditem {
michael@0 17 width: @grid_double_column_width@;
michael@0 18 height: @grid_row_height@;
michael@0 19 }
michael@0 20 richgriditem[tiletype="thumbnail"] {
michael@0 21 width: @grid_double_column_width@;
michael@0 22 height: @grid_double_row_height@;
michael@0 23 }
michael@0 24 richgriditem[search] {
michael@0 25 width: @grid_search_width@;
michael@0 26 height: @grid_row_height@;
michael@0 27 }
michael@0 28 richgriditem[compact] {
michael@0 29 width: auto;
michael@0 30 height: @compactgrid_row_height@;
michael@0 31 }
michael@0 32 /*
michael@0 33 *****************************************************
michael@0 34 */
michael@0 35 richgrid {
michael@0 36 display: -moz-box;
michael@0 37 overflow: hidden;
michael@0 38 }
michael@0 39
michael@0 40 richgrid > .richgrid-grid {
michael@0 41 -moz-column-width: @grid_double_column_width@; /* tile width (2x unit + gutter) */
michael@0 42 min-width: @grid_double_column_width@; /* min 1 column */
michael@0 43 min-height: @grid_double_row_height@; /* 2 rows (or 1 double rows) minimum; multiple of tile_height */
michael@0 44 -moz-column-fill: auto; /* do not attempt to balance content between columns */
michael@0 45 -moz-column-gap: 0;
michael@0 46 -moz-column-count: auto;
michael@0 47 display: block;
michael@0 48 box-sizing: content-box;
michael@0 49 overflow-x: hidden; /* clipping will only kick in if an explicit width is set */
michael@0 50 transition: 100ms transform ease-out;
michael@0 51 }
michael@0 52
michael@0 53 richgrid[search] > .richgrid-grid {
michael@0 54 -moz-column-width: auto;
michael@0 55 min-width: 0;
michael@0 56 }
michael@0 57
michael@0 58 richgriditem {
michael@0 59 display: block;
michael@0 60 position: relative;
michael@0 61 width: @grid_double_column_width@;
michael@0 62 height: @grid_row_height@;
michael@0 63 box-sizing: border-box;
michael@0 64 -moz-column-gap: 0;
michael@0 65 overflow:hidden;
michael@0 66 cursor: default;
michael@0 67 }
michael@0 68
michael@0 69 .tile-content {
michael@0 70 display: block;
michael@0 71 position: absolute;
michael@0 72 /* background-color colors the tile-edge,
michael@0 73 and will normally be overridden with a favicon-based color */
michael@0 74 background-color: #ccc;
michael@0 75 background-origin: padding-box;
michael@0 76 /* content positioning within the grid "cell"
michael@0 77 gives us the gutters/spacing between tiles */
michael@0 78 top: 2px; right: @tile_side_margin@; bottom: 10px; left: @tile_side_margin@;
michael@0 79 border: @metro_border_thin@ solid @tile_border_color@;
michael@0 80 box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.1);
michael@0 81 transition: 150ms transform ease-out,
michael@0 82 @metro_animation_duration@ background-color @metro_animation_easing@;
michael@0 83 }
michael@0 84
michael@0 85 .tile-start-container {
michael@0 86 position: absolute;
michael@0 87 top: 0;
michael@0 88 bottom: 0;
michael@0 89 right: 0;
michael@0 90 left: 10px;
michael@0 91 padding: 8px;
michael@0 92 background-color: #fff;
michael@0 93 }
michael@0 94 richgriditem:-moz-locale-dir(rtl) .tile-start-container {
michael@0 95 right: 10px;
michael@0 96 left: 0;
michael@0 97 }
michael@0 98
michael@0 99 richgriditem[search] .tile-start-container {
michael@0 100 background-color: transparent;
michael@0 101 }
michael@0 102
michael@0 103 richgriditem:not([tiletype="thumbnail"]) .tile-start-container {
michael@0 104 background-image: none!important;
michael@0 105 }
michael@0 106
michael@0 107 .tile-icon-box {
michael@0 108 position: absolute;
michael@0 109 top: 50%;
michael@0 110 margin-top: -17px;
michael@0 111 padding: 8px;
michael@0 112 /* default color, may be overriden by a favicon-based color */
michael@0 113 background-color: white;
michael@0 114 border: 1px solid #ccc;
michael@0 115 border-radius: 1px;
michael@0 116 opacity: 1.0;
michael@0 117 }
michael@0 118
michael@0 119 .tile-icon-box > image {
michael@0 120 display: block;
michael@0 121 width: 16px;
michael@0 122 height: 16px;
michael@0 123 list-style-image: url("chrome://browser/skin/images/identity-icons-generic.png");
michael@0 124 }
michael@0 125
michael@0 126 /* for larger favicons (which includes the fallback icon) */
michael@0 127 richgriditem:not([iconURI]) .tile-icon-box,
michael@0 128 richgriditem[iconURI=""] .tile-icon-box,
michael@0 129 richgriditem[iconsize="large"] .tile-icon-box {
michael@0 130 border-color: transparent!important;
michael@0 131 padding: 4px;
michael@0 132 }
michael@0 133
michael@0 134 richgriditem[iconsize="large"] .tile-icon-box > image,
michael@0 135 .tile-icon-box > image[src=""] {
michael@0 136 width: 24px;
michael@0 137 height: 24px;
michael@0 138 }
michael@0 139
michael@0 140 richgriditem[search] .tile-icon-box {
michael@0 141 padding: 0;
michael@0 142 border: 0;
michael@0 143 left: 50%;
michael@0 144 -moz-margin-start: -13px;
michael@0 145 margin-top: -8px;
michael@0 146 }
michael@0 147
michael@0 148 richgriditem[search]:-moz-locale-dir(rtl) .tile-icon-box {
michael@0 149 right: 50%;
michael@0 150 left: auto;
michael@0 151 }
michael@0 152
michael@0 153
michael@0 154 richgriditem[search][iconsize="large"] .tile-icon-box {
michael@0 155 left: 0;
michael@0 156 top: 0;
michael@0 157 margin: 0;
michael@0 158 }
michael@0 159 richgriditem[search][iconsize="large"]:-moz-locale-dir(rtl) .tile-icon-box {
michael@0 160 right: 0;
michael@0 161 left: auto;
michael@0 162 }
michael@0 163
michael@0 164 richgriditem[search][iconsize="large"] .tile-start-container {
michael@0 165 left: 0;
michael@0 166 padding: 0;
michael@0 167 }
michael@0 168 richgriditem[search][iconsize="large"]:-moz-locale-dir(rtl) .tile-start-container {
michael@0 169 left: auto;
michael@0 170 right: 0;
michael@0 171 }
michael@0 172
michael@0 173 richgriditem[search][iconsize="large"] .tile-icon-box > image {
michael@0 174 width: 74px;
michael@0 175 height: 74px;
michael@0 176 }
michael@0 177
michael@0 178 richgriditem[search] .tile-desc {
michael@0 179 display: none;
michael@0 180 }
michael@0 181
michael@0 182 richgriditem[search] .tile-content {
michael@0 183 border: 0;
michael@0 184 }
michael@0 185
michael@0 186 .tile-desc {
michael@0 187 display: block;
michael@0 188 position: absolute;
michael@0 189 top: 6px;
michael@0 190 left: 52px; /* label goes to the end (right) of the favicon */
michael@0 191 right: 0;
michael@0 192 padding-top: 1em;
michael@0 193 -moz-padding-end: 6px;
michael@0 194 padding-bottom: 6px;
michael@0 195 -moz-padding-start: 12px;
michael@0 196 background: white;
michael@0 197 color: #333;
michael@0 198 margin: 0;
michael@0 199 -moz-margin-start: 0;
michael@0 200 display: block;
michael@0 201 font-size: 16px;
michael@0 202 overflow: hidden;
michael@0 203 white-space: nowrap;
michael@0 204 text-overflow: ellipsis;
michael@0 205 transition: @metro_animation_duration@ background-color @metro_animation_easing@;
michael@0 206 }
michael@0 207 richgriditem:-moz-locale-dir(rtl) .tile-desc {
michael@0 208 right: 52px; /* label goes to the end (left) of the favicon */
michael@0 209 left: 0;
michael@0 210 }
michael@0 211
michael@0 212 richgriditem:not([tiletype="thumbnail"]) .tile-desc {
michael@0 213 background-color: transparent!important;
michael@0 214 }
michael@0 215
michael@0 216
michael@0 217 richgriditem.collapsed {
michael@0 218 height: 0!important;
michael@0 219 overflow: hidden;
michael@0 220 opacity: 0;
michael@0 221 }
michael@0 222
michael@0 223 richgriditem.collapsed > .tile-content {
michael@0 224 transform: scaleY(0);
michael@0 225 transition: 150ms transform ease-out 150ms;
michael@0 226 }
michael@0 227
michael@0 228 richgriditem:active {
michael@0 229 z-index: 2;
michael@0 230 }
michael@0 231
michael@0 232 /* thumbnail variation */
michael@0 233
michael@0 234 richgriditem[tiletype="thumbnail"] {
michael@0 235 width: @grid_double_column_width@;
michael@0 236 height: @grid_double_row_height@;
michael@0 237 -moz-box-pack: end;
michael@0 238 padding: 0px;
michael@0 239 color: #1a1a1a;
michael@0 240 }
michael@0 241
michael@0 242 richgriditem[tiletype="thumbnail"] .tile-desc {
michael@0 243 margin: 0;
michael@0 244 top: auto;
michael@0 245 bottom: 0;
michael@0 246 left: 0;
michael@0 247 right: 0;
michael@0 248 padding-top: 4px;
michael@0 249 -moz-padding-end: 8px;
michael@0 250 padding-bottom: 4px;
michael@0 251 -moz-padding-start: 56px;
michael@0 252 }
michael@0 253
michael@0 254 richgriditem[tiletype="thumbnail"] > .tile-content > .tile-desc {
michael@0 255 /* ensure thumbnail labels get their color from the parent richgriditem element */
michael@0 256 color: inherit;
michael@0 257 }
michael@0 258
michael@0 259 /* thumbnail tiles use a screenshot thumbnail as the background */
michael@0 260
michael@0 261 richgriditem[tiletype="thumbnail"] > .tile-content > .tile-start-container,
michael@0 262 richgriditem[tiletype="thumbnail"] > .tile-content > .tile-start-container::after {
michael@0 263 background-size: cover;
michael@0 264 background-position: top left;
michael@0 265 background-repeat: no-repeat;
michael@0 266 position: absolute;
michael@0 267 top: 0;
michael@0 268 bottom: 0;
michael@0 269 right: 0;
michael@0 270 left: 0;
michael@0 271 }
michael@0 272
michael@0 273 richgriditem[tiletype="thumbnail"] > .tile-content > .tile-start-container::after {
michael@0 274 pointer-events:none;
michael@0 275 content: "";
michael@0 276 display: block;
michael@0 277 opacity: 0;
michael@0 278 background-color: #fff;
michael@0 279 background-image: url("chrome://browser/skin/images/firefox-watermark.png")!important;
michael@0 280 transition: @metro_animation_duration@ opacity ease-in;
michael@0 281 }
michael@0 282
michael@0 283 richgriditem[tiletype="thumbnail"]:not([customImage]) > .tile-content > .tile-start-container::after {
michael@0 284 opacity: 1;
michael@0 285 }
michael@0 286
michael@0 287 richgriditem[tiletype="thumbnail"] .tile-icon-box {
michael@0 288 top: auto;
michael@0 289 left: 10px;
michael@0 290 bottom: 6px;
michael@0 291 margin-top: 0;
michael@0 292 z-index: 1;
michael@0 293 box-shadow: 0px 0px 2px 2px rgba(0, 0, 0, 0.05), 0px 2px 0px rgba(0, 0, 0, 0.1);
michael@0 294 }
michael@0 295 richgriditem[tiletype="thumbnail"]:-moz-locale-dir(rtl) .tile-icon-box {
michael@0 296 left: auto;
michael@0 297 right: 10px;
michael@0 298 }
michael@0 299
michael@0 300 /* selected tile indicator */
michael@0 301 richgriditem[selected] > .tile-content::after {
michael@0 302 content: "";
michael@0 303 pointer-events: none;
michael@0 304 display: block;
michael@0 305 position: absolute;
michael@0 306 top: 0;
michael@0 307 right: 0;
michael@0 308 bottom: 0;
michael@0 309 left: 0;
michael@0 310 z-index: 1;
michael@0 311 background-image: url(chrome://browser/skin/images/tile-selected-check-hdpi.png);
michael@0 312 background-origin: border-box;
michael@0 313 background-repeat: no-repeat;
michael@0 314 background-position: right 0 top 0;
michael@0 315 /* scale the image whatever the dppx */
michael@0 316 background-size: 35px 35px;
michael@0 317 border: @metro_border_xthick@ solid @selected_color@;
michael@0 318 }
michael@0 319 richgriditem[selected]:-moz-locale-dir(rtl) > .tile-content::after {
michael@0 320 background-position: left 0 top 0;
michael@0 321 background-image: url(chrome://browser/skin/images/tile-selected-check-rtl-hdpi.png);
michael@0 322 }
michael@0 323
michael@0 324 richgriditem[crosssliding] {
michael@0 325 z-index: 10;
michael@0 326 }
michael@0 327
michael@0 328 /* ease the return to original position when cross-sliding */
michael@0 329 richgriditem:not([crosssliding]) {
michael@0 330 transition: transform ease-out 0.2s;
michael@0 331 }
michael@0 332
michael@0 333
michael@0 334 /* tile pinned-state indication */
michael@0 335 richgriditem[pinned] > .tile-content::before {
michael@0 336 pointer-events:none;
michael@0 337 content: "";
michael@0 338 display: block;
michael@0 339 position: absolute;
michael@0 340 top: 0;
michael@0 341 right: 0;
michael@0 342 left: auto;
michael@0 343 z-index: 1;
michael@0 344 width: 35px;
michael@0 345 height: 35px;
michael@0 346 background-image: url(chrome://browser/skin/images/pinned-hdpi.png);
michael@0 347 background-position: center;
michael@0 348 background-repeat: no-repeat;
michael@0 349 /* scale the image whatever the dppx */
michael@0 350 background-size: 70px 70px;
michael@0 351 }
michael@0 352 richgriditem[pinned]:-moz-locale-dir(rtl) > .tile-content::before {
michael@0 353 left: 0;
michael@0 354 right: auto;
michael@0 355 -moz-transform: scaleX(-1);
michael@0 356 }
michael@0 357
michael@0 358
michael@0 359 /* Selected _and_ pinned tiles*/
michael@0 360 richgriditem[selected][pinned] > .tile-content::before {
michael@0 361 background-position: right -@metro_border_xthick@ top -@metro_border_xthick@;
michael@0 362 width: 70px;
michael@0 363 height: 70px;
michael@0 364 }
michael@0 365 richgriditem[selected][pinned]:-moz-locale-dir(rtl) > .tile-content::before {
michael@0 366 background-position: left -@metro_border_xthick@ top -@metro_border_xthick@;
michael@0 367 }
michael@0 368
michael@0 369 richgriditem[customColor] {
michael@0 370 color: #f1f1f1;
michael@0 371 }
michael@0 372
michael@0 373 richgriditem[bending] > .tile-content {
michael@0 374 transform-origin: center center;
michael@0 375 }
michael@0 376
michael@0 377 richgriditem[tiletype="thumbnail"]:not([value]) {
michael@0 378 visibility: visible;
michael@0 379 }
michael@0 380 richgriditem:not([value]) > .tile-content {
michael@0 381 padding: 10px 14px;
michael@0 382 }
michael@0 383 /* Empty/unused tiles */
michael@0 384 richgriditem:not([value]) > .tile-content {
michael@0 385 box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.05);
michael@0 386 background-image: url("chrome://browser/skin/images/firefox-watermark.png");
michael@0 387 background-origin: content-box;
michael@0 388 background-repeat: no-repeat;
michael@0 389 background-color: rgba(255,255,255, 0.2);
michael@0 390 background-position: center center;
michael@0 391 background-size: @compactgrid_row_height@;
michael@0 392 }
michael@0 393 richgriditem[tiletype="thumbnail"]:not([value]) > .tile-content {
michael@0 394 background-size: @grid_row_height@;
michael@0 395 }
michael@0 396
michael@0 397 /* Snapped-view variation
michael@0 398 We use the compact, single-column grid treatment for <=320px */
michael@0 399
michael@0 400 @media (max-width: 330px) {
michael@0 401
michael@0 402 richgrid:not([search]) > .richgrid-grid {
michael@0 403 -moz-column-width: auto!important; /* let it flow */
michael@0 404 -moz-column-count: auto!important; /* let it flow */
michael@0 405 height: auto; /* let it flow */
michael@0 406 min-width: 280px;
michael@0 407 transition: 100ms transform ease-out;
michael@0 408 }
michael@0 409
michael@0 410 richgriditem {
michael@0 411 width: @grid_double_column_width@;
michael@0 412 overflow: hidden;
michael@0 413 height: @compactgrid_row_height@;
michael@0 414 }
michael@0 415
michael@0 416 .tile-desc {
michael@0 417 padding-top: 0.5em;
michael@0 418 -moz-padding-end: 4px;
michael@0 419 padding-bottom: 4px;
michael@0 420 -moz-padding-start: 4px;
michael@0 421 }
michael@0 422
michael@0 423 richgriditem:not([search]) > .tile-content {
michael@0 424 left: 0;
michael@0 425 right: 0;
michael@0 426 }
michael@0 427
michael@0 428 richgriditem {
michael@0 429 width: auto;
michael@0 430 }
michael@0 431 }

mercurial