Skip to content

Commit

Permalink
update UA stylesheets
Browse files Browse the repository at this point in the history
  • Loading branch information
aminomancer committed Sep 21, 2022
1 parent 404a1ed commit 1ac8b46
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 24 deletions.
6 changes: 0 additions & 6 deletions resources/in-content/root.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@
font-weight: 300;
}

@media not print {
img.transparent {
background: var(--transparent-img-background) !important;
}
}

@media (prefers-color-scheme: dark) {
:root {
color: var(--plaintext-color) !important;
Expand Down
5 changes: 5 additions & 0 deletions resources/layout/contentaccessible/ImageDocument.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ body {
}
}

.isInObjectOrEmbed {
width: 100%;
height: 100vh;
}

img {
display: block;
}
11 changes: 7 additions & 4 deletions resources/layout/contentaccessible/TopLevelImageDocument.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@
are top level (e.g. not iframes).
*/

@import url(chrome://userchrome/content/layout/uc-low-globals.css);

@media not print {
img {
text-align: center;
position: absolute;
inset: 0;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
}

img.transparent {
background: var(--transparent-img-background);
}

img.overflowingVertical {
Expand Down
16 changes: 7 additions & 9 deletions resources/layout/contentaccessible/TopLevelVideoDocument.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,18 @@
are top level (e.g. not iframes).
*/

body {
:root {
background-color: black;
/* Fill the viewport height, so that our '-moz-user-focus' styling will
disregard clicks in the whole background area (so the video element
doesn't inadvertently lose focus from a stray click on the background). */
height: 100%;
width: 100%;
margin: 0;
padding: 0;
-moz-user-focus: ignore;
}

video {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
inset: 0;
margin: auto;
max-width: 100%;
max-height: 100%;
Expand All @@ -30,5 +28,5 @@ video {
}

video:focus {
outline-width: 0;
outline-style: none;
}
22 changes: 22 additions & 0 deletions resources/layout/contentaccessible/details.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

slot:not([name]) {
display: none;
}
/* Either the fallback summary (inside the shadow tree), or the slotted main
summary. */
summary,
slot[name=internal-main-summary]::slotted(summary) {
display: list-item;
counter-increment: list-item 0;
list-style: disclosure-closed inside;
}
:host([open]) summary,
:host([open]) slot[name=internal-main-summary]::slotted(summary) {
list-style-type: disclosure-open;
}
:host([open]) slot:not([name]) {
display: revert;
}
8 changes: 8 additions & 0 deletions resources/layout/contentaccessible/plaintext.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ pre {
white-space: pre;
}

/* Make text go with the rules of dir=auto, but allow it to be overriden if 'Switch Text Direction' is triggered */
html:not([dir]) pre {
/* Not a UA sheet, so doesn't use :-moz-has-dir-attr */
unicode-bidi: plaintext;
}

Expand All @@ -33,6 +35,12 @@ html:not([dir]) pre {
}
}

/* NOTE(emilio): For some reason some pages, mainly bing.com, load a bunch of
* scripts in zero-size <object> elements, see bug 1548449.
*
* Line-breaking such documents is useless and pretty expensive, so only render
* them if there's a viewport. Sigh.
*/
@media (width: 0) or (height: 0) {
:root {
display: none;
Expand Down
4 changes: 4 additions & 0 deletions resources/layout/uc-low-globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ tooltip {
--tooltip-border-radius: 3px;
--tooltip-border-color: var(--uc-menu-border-color);
--tooltip-box-shadow: 0 0 5px hsla(0, 0%, 0%, 0.2);
--transparent-img-background: center/16px repeat hsla(0, 0%, 80%)
url(chrome://userchrome/content/checker.svg);
--transparent-img-background-context: center/16px repeat
url(chrome://userchrome/content/checker-context.svg);
}
5 changes: 0 additions & 5 deletions uc-globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@ but other than that these variables should be available everywhere. */
--global-focus-shadow: 0 0 0 2px var(--global-focus-shadow-color);
--global-focus-outline-offset: -2px;

--transparent-img-background: center/16px repeat hsla(0, 0%, 80%)
url(chrome://userchrome/content/checker.svg);
--transparent-img-background-context: center/16px repeat
url(chrome://userchrome/content/checker-context.svg);

--acrylic-blur: blur(15px);
--acrylic-texture: url(chrome://userchrome/content/texture/lightnoise.png);
--acrylic-blue: hsla(233.3, 39.1%, 9%, 0.58);
Expand Down

0 comments on commit 1ac8b46

Please sign in to comment.