accessiblecaret.css (2883B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 :host { 6 /* Add transition effect to make caret size changing smoother. */ 7 transition-property: width, height, margin-left; 8 9 position: absolute; 10 z-index: 2147483647; 11 } 12 13 :host(.none) { 14 display: none; 15 } 16 17 :host(.hidden) { 18 visibility: hidden; 19 } 20 21 #image, 22 #text-overlay { 23 width: 100%; 24 25 /* Override this property in moz-custom-content-container to make dummy touch 26 * listener work. */ 27 pointer-events: auto; 28 29 @media (-moz-platform: android) { 30 /* border: 0.1px solid red; */ /* Uncomment border to see the touch target. */ 31 padding-left: 59%; /* Enlarge the touch area. ((48-22)/2)px / 22px ~= 59% */ 32 padding-right: 59%; /* Enlarge the touch area. */ 33 margin-left: -59%; 34 } 35 36 :host(.left) > & { 37 margin-left: -39%; 38 @media (-moz-platform: android) { 39 margin-left: -109%; 40 } 41 } 42 43 :host(.right) > & { 44 margin-left: 41%; 45 @media (-moz-platform: android) { 46 margin-left: -12%; 47 } 48 } 49 } 50 51 #image { 52 background-position: center top; 53 background-size: 100%; 54 background-repeat: no-repeat; 55 background-origin: content-box; 56 57 @media (-moz-platform: android) { 58 padding-bottom: 59%; /* Enlarge the touch area. */ 59 } 60 61 :host(.normal) > & { 62 background-image: image-set( 63 url("resource://gre-resources/accessiblecaret-normal@1x.png"), 64 url("resource://gre-resources/accessiblecaret-normal@1.5x.png") 1.5x, 65 url("resource://gre-resources/accessiblecaret-normal@2x.png") 2x, 66 url("resource://gre-resources/accessiblecaret-normal@2.25x.png") 2.25x 67 ); 68 @media (-moz-platform: android) { 69 background-image: url("resource://gre-resources/accessiblecaret-normal.svg"); 70 } 71 } 72 73 :host(.left) > & { 74 background-image: image-set( 75 url("resource://gre-resources/accessiblecaret-tilt-left@1x.png"), 76 url("resource://gre-resources/accessiblecaret-tilt-left@1.5x.png") 1.5x, 77 url("resource://gre-resources/accessiblecaret-tilt-left@2x.png") 2x, 78 url("resource://gre-resources/accessiblecaret-tilt-left@2.25x.png") 2.25x 79 ); 80 @media (-moz-platform: android) { 81 background-image: url("resource://gre-resources/accessiblecaret-tilt-left.svg"); 82 } 83 } 84 85 :host(.right) > & { 86 background-image: image-set( 87 url("resource://gre-resources/accessiblecaret-tilt-right@1x.png"), 88 url("resource://gre-resources/accessiblecaret-tilt-right@1.5x.png") 1.5x, 89 url("resource://gre-resources/accessiblecaret-tilt-right@2x.png") 2x, 90 url("resource://gre-resources/accessiblecaret-tilt-right@2.25x.png") 2.25x 91 ); 92 @media (-moz-platform: android) { 93 background-image: url("resource://gre-resources/accessiblecaret-tilt-right.svg"); 94 } 95 } 96 }