michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* Tile grid ------------------------------------------------------------- */ michael@0: michael@0: %filter substitution michael@0: %include defines.inc michael@0: michael@0: /* michael@0: ***************************************************** michael@0: The following rules define the key tile dimensions michael@0: They are (also) snarfed via the CSSOM as the dimensions used in the #richgrid binding michael@0: ***************************************************** michael@0: */ michael@0: richgriditem { michael@0: width: @grid_double_column_width@; michael@0: height: @grid_row_height@; michael@0: } michael@0: richgriditem[tiletype="thumbnail"] { michael@0: width: @grid_double_column_width@; michael@0: height: @grid_double_row_height@; michael@0: } michael@0: richgriditem[search] { michael@0: width: @grid_search_width@; michael@0: height: @grid_row_height@; michael@0: } michael@0: richgriditem[compact] { michael@0: width: auto; michael@0: height: @compactgrid_row_height@; michael@0: } michael@0: /* michael@0: ***************************************************** michael@0: */ michael@0: richgrid { michael@0: display: -moz-box; michael@0: overflow: hidden; michael@0: } michael@0: michael@0: richgrid > .richgrid-grid { michael@0: -moz-column-width: @grid_double_column_width@; /* tile width (2x unit + gutter) */ michael@0: min-width: @grid_double_column_width@; /* min 1 column */ michael@0: min-height: @grid_double_row_height@; /* 2 rows (or 1 double rows) minimum; multiple of tile_height */ michael@0: -moz-column-fill: auto; /* do not attempt to balance content between columns */ michael@0: -moz-column-gap: 0; michael@0: -moz-column-count: auto; michael@0: display: block; michael@0: box-sizing: content-box; michael@0: overflow-x: hidden; /* clipping will only kick in if an explicit width is set */ michael@0: transition: 100ms transform ease-out; michael@0: } michael@0: michael@0: richgrid[search] > .richgrid-grid { michael@0: -moz-column-width: auto; michael@0: min-width: 0; michael@0: } michael@0: michael@0: richgriditem { michael@0: display: block; michael@0: position: relative; michael@0: width: @grid_double_column_width@; michael@0: height: @grid_row_height@; michael@0: box-sizing: border-box; michael@0: -moz-column-gap: 0; michael@0: overflow:hidden; michael@0: cursor: default; michael@0: } michael@0: michael@0: .tile-content { michael@0: display: block; michael@0: position: absolute; michael@0: /* background-color colors the tile-edge, michael@0: and will normally be overridden with a favicon-based color */ michael@0: background-color: #ccc; michael@0: background-origin: padding-box; michael@0: /* content positioning within the grid "cell" michael@0: gives us the gutters/spacing between tiles */ michael@0: top: 2px; right: @tile_side_margin@; bottom: 10px; left: @tile_side_margin@; michael@0: border: @metro_border_thin@ solid @tile_border_color@; michael@0: box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.1); michael@0: transition: 150ms transform ease-out, michael@0: @metro_animation_duration@ background-color @metro_animation_easing@; michael@0: } michael@0: michael@0: .tile-start-container { michael@0: position: absolute; michael@0: top: 0; michael@0: bottom: 0; michael@0: right: 0; michael@0: left: 10px; michael@0: padding: 8px; michael@0: background-color: #fff; michael@0: } michael@0: richgriditem:-moz-locale-dir(rtl) .tile-start-container { michael@0: right: 10px; michael@0: left: 0; michael@0: } michael@0: michael@0: richgriditem[search] .tile-start-container { michael@0: background-color: transparent; michael@0: } michael@0: michael@0: richgriditem:not([tiletype="thumbnail"]) .tile-start-container { michael@0: background-image: none!important; michael@0: } michael@0: michael@0: .tile-icon-box { michael@0: position: absolute; michael@0: top: 50%; michael@0: margin-top: -17px; michael@0: padding: 8px; michael@0: /* default color, may be overriden by a favicon-based color */ michael@0: background-color: white; michael@0: border: 1px solid #ccc; michael@0: border-radius: 1px; michael@0: opacity: 1.0; michael@0: } michael@0: michael@0: .tile-icon-box > image { michael@0: display: block; michael@0: width: 16px; michael@0: height: 16px; michael@0: list-style-image: url("chrome://browser/skin/images/identity-icons-generic.png"); michael@0: } michael@0: michael@0: /* for larger favicons (which includes the fallback icon) */ michael@0: richgriditem:not([iconURI]) .tile-icon-box, michael@0: richgriditem[iconURI=""] .tile-icon-box, michael@0: richgriditem[iconsize="large"] .tile-icon-box { michael@0: border-color: transparent!important; michael@0: padding: 4px; michael@0: } michael@0: michael@0: richgriditem[iconsize="large"] .tile-icon-box > image, michael@0: .tile-icon-box > image[src=""] { michael@0: width: 24px; michael@0: height: 24px; michael@0: } michael@0: michael@0: richgriditem[search] .tile-icon-box { michael@0: padding: 0; michael@0: border: 0; michael@0: left: 50%; michael@0: -moz-margin-start: -13px; michael@0: margin-top: -8px; michael@0: } michael@0: michael@0: richgriditem[search]:-moz-locale-dir(rtl) .tile-icon-box { michael@0: right: 50%; michael@0: left: auto; michael@0: } michael@0: michael@0: michael@0: richgriditem[search][iconsize="large"] .tile-icon-box { michael@0: left: 0; michael@0: top: 0; michael@0: margin: 0; michael@0: } michael@0: richgriditem[search][iconsize="large"]:-moz-locale-dir(rtl) .tile-icon-box { michael@0: right: 0; michael@0: left: auto; michael@0: } michael@0: michael@0: richgriditem[search][iconsize="large"] .tile-start-container { michael@0: left: 0; michael@0: padding: 0; michael@0: } michael@0: richgriditem[search][iconsize="large"]:-moz-locale-dir(rtl) .tile-start-container { michael@0: left: auto; michael@0: right: 0; michael@0: } michael@0: michael@0: richgriditem[search][iconsize="large"] .tile-icon-box > image { michael@0: width: 74px; michael@0: height: 74px; michael@0: } michael@0: michael@0: richgriditem[search] .tile-desc { michael@0: display: none; michael@0: } michael@0: michael@0: richgriditem[search] .tile-content { michael@0: border: 0; michael@0: } michael@0: michael@0: .tile-desc { michael@0: display: block; michael@0: position: absolute; michael@0: top: 6px; michael@0: left: 52px; /* label goes to the end (right) of the favicon */ michael@0: right: 0; michael@0: padding-top: 1em; michael@0: -moz-padding-end: 6px; michael@0: padding-bottom: 6px; michael@0: -moz-padding-start: 12px; michael@0: background: white; michael@0: color: #333; michael@0: margin: 0; michael@0: -moz-margin-start: 0; michael@0: display: block; michael@0: font-size: 16px; michael@0: overflow: hidden; michael@0: white-space: nowrap; michael@0: text-overflow: ellipsis; michael@0: transition: @metro_animation_duration@ background-color @metro_animation_easing@; michael@0: } michael@0: richgriditem:-moz-locale-dir(rtl) .tile-desc { michael@0: right: 52px; /* label goes to the end (left) of the favicon */ michael@0: left: 0; michael@0: } michael@0: michael@0: richgriditem:not([tiletype="thumbnail"]) .tile-desc { michael@0: background-color: transparent!important; michael@0: } michael@0: michael@0: michael@0: richgriditem.collapsed { michael@0: height: 0!important; michael@0: overflow: hidden; michael@0: opacity: 0; michael@0: } michael@0: michael@0: richgriditem.collapsed > .tile-content { michael@0: transform: scaleY(0); michael@0: transition: 150ms transform ease-out 150ms; michael@0: } michael@0: michael@0: richgriditem:active { michael@0: z-index: 2; michael@0: } michael@0: michael@0: /* thumbnail variation */ michael@0: michael@0: richgriditem[tiletype="thumbnail"] { michael@0: width: @grid_double_column_width@; michael@0: height: @grid_double_row_height@; michael@0: -moz-box-pack: end; michael@0: padding: 0px; michael@0: color: #1a1a1a; michael@0: } michael@0: michael@0: richgriditem[tiletype="thumbnail"] .tile-desc { michael@0: margin: 0; michael@0: top: auto; michael@0: bottom: 0; michael@0: left: 0; michael@0: right: 0; michael@0: padding-top: 4px; michael@0: -moz-padding-end: 8px; michael@0: padding-bottom: 4px; michael@0: -moz-padding-start: 56px; michael@0: } michael@0: michael@0: richgriditem[tiletype="thumbnail"] > .tile-content > .tile-desc { michael@0: /* ensure thumbnail labels get their color from the parent richgriditem element */ michael@0: color: inherit; michael@0: } michael@0: michael@0: /* thumbnail tiles use a screenshot thumbnail as the background */ michael@0: michael@0: richgriditem[tiletype="thumbnail"] > .tile-content > .tile-start-container, michael@0: richgriditem[tiletype="thumbnail"] > .tile-content > .tile-start-container::after { michael@0: background-size: cover; michael@0: background-position: top left; michael@0: background-repeat: no-repeat; michael@0: position: absolute; michael@0: top: 0; michael@0: bottom: 0; michael@0: right: 0; michael@0: left: 0; michael@0: } michael@0: michael@0: richgriditem[tiletype="thumbnail"] > .tile-content > .tile-start-container::after { michael@0: pointer-events:none; michael@0: content: ""; michael@0: display: block; michael@0: opacity: 0; michael@0: background-color: #fff; michael@0: background-image: url("chrome://browser/skin/images/firefox-watermark.png")!important; michael@0: transition: @metro_animation_duration@ opacity ease-in; michael@0: } michael@0: michael@0: richgriditem[tiletype="thumbnail"]:not([customImage]) > .tile-content > .tile-start-container::after { michael@0: opacity: 1; michael@0: } michael@0: michael@0: richgriditem[tiletype="thumbnail"] .tile-icon-box { michael@0: top: auto; michael@0: left: 10px; michael@0: bottom: 6px; michael@0: margin-top: 0; michael@0: z-index: 1; michael@0: box-shadow: 0px 0px 2px 2px rgba(0, 0, 0, 0.05), 0px 2px 0px rgba(0, 0, 0, 0.1); michael@0: } michael@0: richgriditem[tiletype="thumbnail"]:-moz-locale-dir(rtl) .tile-icon-box { michael@0: left: auto; michael@0: right: 10px; michael@0: } michael@0: michael@0: /* selected tile indicator */ michael@0: richgriditem[selected] > .tile-content::after { michael@0: content: ""; michael@0: pointer-events: none; michael@0: display: block; michael@0: position: absolute; michael@0: top: 0; michael@0: right: 0; michael@0: bottom: 0; michael@0: left: 0; michael@0: z-index: 1; michael@0: background-image: url(chrome://browser/skin/images/tile-selected-check-hdpi.png); michael@0: background-origin: border-box; michael@0: background-repeat: no-repeat; michael@0: background-position: right 0 top 0; michael@0: /* scale the image whatever the dppx */ michael@0: background-size: 35px 35px; michael@0: border: @metro_border_xthick@ solid @selected_color@; michael@0: } michael@0: richgriditem[selected]:-moz-locale-dir(rtl) > .tile-content::after { michael@0: background-position: left 0 top 0; michael@0: background-image: url(chrome://browser/skin/images/tile-selected-check-rtl-hdpi.png); michael@0: } michael@0: michael@0: richgriditem[crosssliding] { michael@0: z-index: 10; michael@0: } michael@0: michael@0: /* ease the return to original position when cross-sliding */ michael@0: richgriditem:not([crosssliding]) { michael@0: transition: transform ease-out 0.2s; michael@0: } michael@0: michael@0: michael@0: /* tile pinned-state indication */ michael@0: richgriditem[pinned] > .tile-content::before { michael@0: pointer-events:none; michael@0: content: ""; michael@0: display: block; michael@0: position: absolute; michael@0: top: 0; michael@0: right: 0; michael@0: left: auto; michael@0: z-index: 1; michael@0: width: 35px; michael@0: height: 35px; michael@0: background-image: url(chrome://browser/skin/images/pinned-hdpi.png); michael@0: background-position: center; michael@0: background-repeat: no-repeat; michael@0: /* scale the image whatever the dppx */ michael@0: background-size: 70px 70px; michael@0: } michael@0: richgriditem[pinned]:-moz-locale-dir(rtl) > .tile-content::before { michael@0: left: 0; michael@0: right: auto; michael@0: -moz-transform: scaleX(-1); michael@0: } michael@0: michael@0: michael@0: /* Selected _and_ pinned tiles*/ michael@0: richgriditem[selected][pinned] > .tile-content::before { michael@0: background-position: right -@metro_border_xthick@ top -@metro_border_xthick@; michael@0: width: 70px; michael@0: height: 70px; michael@0: } michael@0: richgriditem[selected][pinned]:-moz-locale-dir(rtl) > .tile-content::before { michael@0: background-position: left -@metro_border_xthick@ top -@metro_border_xthick@; michael@0: } michael@0: michael@0: richgriditem[customColor] { michael@0: color: #f1f1f1; michael@0: } michael@0: michael@0: richgriditem[bending] > .tile-content { michael@0: transform-origin: center center; michael@0: } michael@0: michael@0: richgriditem[tiletype="thumbnail"]:not([value]) { michael@0: visibility: visible; michael@0: } michael@0: richgriditem:not([value]) > .tile-content { michael@0: padding: 10px 14px; michael@0: } michael@0: /* Empty/unused tiles */ michael@0: richgriditem:not([value]) > .tile-content { michael@0: box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.05); michael@0: background-image: url("chrome://browser/skin/images/firefox-watermark.png"); michael@0: background-origin: content-box; michael@0: background-repeat: no-repeat; michael@0: background-color: rgba(255,255,255, 0.2); michael@0: background-position: center center; michael@0: background-size: @compactgrid_row_height@; michael@0: } michael@0: richgriditem[tiletype="thumbnail"]:not([value]) > .tile-content { michael@0: background-size: @grid_row_height@; michael@0: } michael@0: michael@0: /* Snapped-view variation michael@0: We use the compact, single-column grid treatment for <=320px */ michael@0: michael@0: @media (max-width: 330px) { michael@0: michael@0: richgrid:not([search]) > .richgrid-grid { michael@0: -moz-column-width: auto!important; /* let it flow */ michael@0: -moz-column-count: auto!important; /* let it flow */ michael@0: height: auto; /* let it flow */ michael@0: min-width: 280px; michael@0: transition: 100ms transform ease-out; michael@0: } michael@0: michael@0: richgriditem { michael@0: width: @grid_double_column_width@; michael@0: overflow: hidden; michael@0: height: @compactgrid_row_height@; michael@0: } michael@0: michael@0: .tile-desc { michael@0: padding-top: 0.5em; michael@0: -moz-padding-end: 4px; michael@0: padding-bottom: 4px; michael@0: -moz-padding-start: 4px; michael@0: } michael@0: michael@0: richgriditem:not([search]) > .tile-content { michael@0: left: 0; michael@0: right: 0; michael@0: } michael@0: michael@0: richgriditem { michael@0: width: auto; michael@0: } michael@0: }