Revision control

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
#pageActionActivatedActionPanel[actionID="pocket"] > .panel-arrowcontainer > .panel-arrowcontent {
  padding-top: 0;
  padding-bottom: 0;
}

#pocket-button {
  list-style-image: url("chrome://pocket-shared/skin/pocket.svg");
}

#pocket-button-box[animate="true"] > #pocket-button,
#pocket-button[open="true"][animationsenabled] > .toolbarbutton-icon {
  fill: transparent;
}

#pocket-button-box[open="true"] > #pocket-button {
  fill: #ef4056;
  fill-opacity: 1;
}

@keyframes pocket-animation {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-240px);
  }
}

@keyframes pocket-animation-rtl {
  from {
    transform: scaleX(-1) translateX(0);
  }
  to {
    transform: scaleX(-1) translateX(-240px);
  }
}

#pocket-button-box[animate="true"] > #pocket-animatable-box,
#pocket-button > .toolbarbutton-animatable-box {
  position: absolute;
  overflow: hidden;
  top: calc(50% - 8px); /* 8px is half the height of the sprite */
  /* Since .toolbarbutton-icon uses a different width than the animatable box,
     we need to set a padding relative to the difference in widths. */
  margin-inline-start: calc((16px + 2 * var(--toolbarbutton-inner-padding) - 20px) / 2);
  /* Set the min- and max- width and height of the box equal to that
     of each frame of the SVG sprite. Setting the width and height via
     the `width` and `height` CSS properties causes an assertion for
     `inline-size less than zero: 'aContainingBlockISize >= 0'` (bug 1379332). */
  min-width: 20px;
  max-width: 20px;
  min-height: 16px;
  max-height: 16px;
}

#pocket-button-box[animate="true"] > #pocket-animatable-box {
  /* .urlbar-icon has width 28px. Each frame is 20px wide. Set margin-inline-start
     to be half the difference, 4px. */
  margin-inline-start: 4px;
}

#pocket-button-box[animate="true"] > #pocket-animatable-box > #pocket-animatable-image,
#pocket-button > .toolbarbutton-animatable-box > .toolbarbutton-animatable-image {
  height: var(--toolbarbutton-height); /* Height must be equal to height of toolbarbutton padding-box */
}

#pocket-button-box[animate="true"],
#pocket-button[open="true"][animationsenabled][cui-areatype="toolbar"]:not([overflowedItem="true"]) {
  position: relative;
}

#pocket-button-box:not([animate="true"]):not(:hover) > #pocket-animatable-box {
  display: none;
}

/* Preload pocket-animation.svg and library-pocket-animation.svg to prevent
   a flicker at the start of either animation. The preloading of the library
   animation is triggered off of hovering the pocket button since the pocket
   button always animates before the library button. */
#pocket-button-box:not([animate="true"]):hover > #pocket-animatable-box > #pocket-animatable-image,
#pocket-button[animationsenabled][cui-areatype="toolbar"]:not([overflowedItem="true"]):not([open="true"]):hover > .toolbarbutton-animatable-box > .toolbarbutton-animatable-image {
  background-image: url("chrome://pocket-shared/skin/pocket-animation.svg"),
                    url("chrome://pocket-shared/skin/library-pocket-animation.svg");
  background-size: 0, 0;
}

#pocket-button-box[animate="true"] > #pocket-animatable-box > #pocket-animatable-image,
#pocket-button[open="true"][animationsenabled][cui-areatype="toolbar"]:not([overflowedItem="true"]) > .toolbarbutton-animatable-box > .toolbarbutton-animatable-image {
  animation-name: pocket-animation;
  animation-timing-function: steps(12);
  animation-duration: 200ms;
  background-image: url("chrome://pocket-shared/skin/pocket-animation.svg");
  fill: #ef4056;
  -moz-context-properties: fill;
  width: 260px;
}

#pocket-button-box[animate="true"]:-moz-locale-dir(rtl) > #pocket-animatable-box > #pocket-animatable-image,
#pocket-button[open="true"][animationsenabled][cui-areatype="toolbar"]:not([overflowedItem="true"]):-moz-locale-dir(rtl) > .toolbarbutton-animatable-box > .toolbarbutton-animatable-image {
  animation-name: pocket-animation-rtl;
}

#library-button[animate="pocket"] > .toolbarbutton-icon {
  fill: transparent;
}

@keyframes library-pocket-animation {
  from {
    transform: translateX(0);
    fill: inherit;
  }
  25% {
    fill: inherit;
  }
  50% {
    fill: #ef4056;
  }
  to {
    transform: translateX(-1056px);
    fill: #ef4056;
  }
}

@keyframes library-pocket-animation-rtl {
  from {
    transform: scaleX(-1) translateX(0);
    fill: inherit;
  }
  25% {
    fill: inherit;
  }
  50% {
    fill: #ef4056;
  }
  to {
    transform: scaleX(-1) translateX(-1056px);
    fill: #ef4056;
  }
}

/* The animations for the pocket-button and library-button are disabled
   outside of the nav-bar due to bug 1382894. */
:-moz-any(#pocket-button, #library-button) > .toolbarbutton-animatable-box {
  display: none;
}
#nav-bar :-moz-any(#pocket-button, #library-button) > .toolbarbutton-animatable-box {
  display: -moz-box;
}

/* We need to use an animation here instead of a transition
   to guarantee that the animation succeeds. With transitions
   if the starting value is already equal to the end value
   then no transition will occur and thus no transitionend event. */
@keyframes library-pocket-fade {
  from {
    fill: #ef4056;
  }
  to {
    fill: inherit;
  }
}

#library-button[animate="pocket"] {
  position: relative;
}

#library-button[animate="pocket"] > .toolbarbutton-animatable-box {
  position: absolute;
  overflow: hidden;
  top: calc(50% - 27px); /* 27px is half the height of the sprite */
  /* Since .toolbarbutton-icon uses a different width than the animatable box,
     we need to set a padding relative to the difference in widths. */
  margin-inline-start: calc((16px + 2 * var(--toolbarbutton-inner-padding) - 22px) / 2);
  /* Set the min- and max- width and height of the box equal to that
     of each frame of the SVG sprite. Setting the width and height via
     the `width` and `height` CSS properties causes an assertion for
     `inline-size less than zero: 'aContainingBlockISize >= 0'` (bug 1379332). */
  min-width: 22px;
  max-width: 22px;
  /* Height of each frame within the SVG sprite. The sprite must have equal amount
     of space above and below the icon to allow it to vertically center with the
     sprite's icon on top of the toolbar icon when using position:absolute;. */
  min-height: 54px;
  max-height: 54px;
}

#library-button[animate="pocket"] > .toolbarbutton-animatable-box > .toolbarbutton-animatable-image {
  height: var(--toolbarbutton-height); /* Height must be equal to height of toolbarbutton padding-box */
  min-height: 54px; /* Minimum height must be equal to the height of the SVG sprite */
}

#library-button[animate="pocket"] > .toolbarbutton-animatable-box > .toolbarbutton-animatable-image {
  background-image: url("chrome://pocket-shared/skin/library-pocket-animation.svg");
  width: 1078px;
  animation-name: library-pocket-animation;
  animation-duration: 800ms;
  animation-timing-function: steps(48);
}

#library-button[animate="pocket"]:-moz-locale-dir(rtl) > .toolbarbutton-animatable-box > .toolbarbutton-animatable-image {
  animation-name: library-pocket-animation-rtl;
  transform: scaleX(-1);
}

#library-button[animate="pocket"][fade] > .toolbarbutton-animatable-box > .toolbarbutton-animatable-image {
  animation-name: library-pocket-fade;
  animation-duration: 2s;
  animation-timing-function: ease-out;
}

#pocket-button[cui-areatype="toolbar"][open] {
  fill: #ef4056;
}

@media not all and (min-resolution: 1.1dppx) {
  #pocket-button[cui-areatype="menu-panel"],
  toolbarpaletteitem[place="palette"] > #pocket-button {
    list-style-image: url(chrome://pocket/skin/menuPanel.png);
    -moz-image-region: rect(0, 32px, 32px, 0);
  }

  #pocket-button[cui-areatype="menu-panel"][panel-multiview-anchor=true] {
    -moz-image-region: rect(32px, 32px, 64px, 0);
  }
}

@media (min-resolution: 1.1dppx) {
  #pocket-button[cui-areatype="menu-panel"],
  toolbarpaletteitem[place="palette"] > #pocket-button {
    list-style-image: url(chrome://pocket/skin/menuPanel@2x.png);
    -moz-image-region: rect(0px, 64px, 64px, 0);
  }

  #pocket-button[cui-areatype="menu-panel"][panel-multiview-anchor=true] {
    -moz-image-region: rect(64px, 64px, 128px, 0);
  }
}

#appMenu-library-pocket-button {
  list-style-image: url("chrome://pocket-shared/skin/pocket.svg");
}

#panelMenu_pocket,
#menu_pocket,
#BMB_pocket {
  list-style-image: url("chrome://pocket/content/panels/img/pocketmenuitem16.png");
}

@media (min-resolution: 2dppx) {
  #panelMenu_pocket,
  #menu_pocket,
  #BMB_pocket {
    list-style-image: url("chrome://pocket/content/panels/img/pocketmenuitem16@2x.png");
  }

  #panelMenu_pocket > .toolbarbutton-icon {
    width: 16px;
  }
}

#pageAction-panel-pocket,
#pocket-button {
  list-style-image: url("chrome://pocket-shared/skin/pocket.svg");
}