diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /toolkit/themes/osx/global/popup.css | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/themes/osx/global/popup.css')
-rw-r--r-- | toolkit/themes/osx/global/popup.css | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/toolkit/themes/osx/global/popup.css b/toolkit/themes/osx/global/popup.css new file mode 100644 index 0000000000..f748a0b35b --- /dev/null +++ b/toolkit/themes/osx/global/popup.css @@ -0,0 +1,96 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); +@namespace html url("http://www.w3.org/1999/xhtml"); + +menupopup, +panel { + appearance: auto; + -moz-default-appearance: menupopup; + /* We set the default background here, rather than on ::part(content), + * because otherwise it'd interfere with the native look. Non-native-looking + * popups should get their background via --panel-background */ + background-color: Menu; + --panel-background: none; + --panel-color: MenuText; + --panel-padding: 0; + --panel-border-color: transparent; + --panel-border-radius: 0; + --panel-width: initial; + + /* This var is used on panelUI-shared.css to calculate panel shadow margins, + * but as shadows on macOS are being taken care of by the OS, there's + * no need for CSS to do calculations, so just set it to 0px here. */ + --panel-shadow-margin: 0px; + --panel-shadow: none; +} + +menupopup > menu > menupopup { + margin-top: -4px; +} + +menupopup { + --panel-padding: 4px 0; +} + +panel[titlebar] { + appearance: none; /* to disable rounded corners */ +} + +:is(panel, menupopup)[type="arrow"] { + appearance: none; + background: transparent; +} + +:is(panel, menupopup)::part(content) { + display: flex; + box-sizing: border-box; + -moz-font-smoothing-background-color: var(--panel-background, -moz-mac-menupopup); + background: var(--panel-background); + color: var(--panel-color); + box-shadow: var(--panel-shadow); + padding: var(--panel-padding); + margin: var(--panel-shadow-margin); + width: var(--panel-width); + border-radius: var(--panel-border-radius); + border: 1px solid var(--panel-border-color); + + min-width: 0; + min-height: 0; + + /* Makes popup constraints work */ + max-height: calc(100% - 2 * var(--panel-shadow-margin)); + max-width: calc(100% - 2 * var(--panel-shadow-margin)); +} + +:is(panel, menupopup)[orient=vertical]::part(content) { + flex-direction: column; +} + +:is(panel, menupopup)[type="arrow"]::part(content) { + margin: 1px; +} + +panel[type="arrow"].panel-no-padding::part(content) { + padding: 0; + overflow: hidden; /* Don't let panel content overflow the border-radius */ +} + +/* rules for popups associated with menulists */ + +menulist > menupopup { + min-width: 0; + --panel-padding: 4px 0; +} + +menulist > menupopup:not([position]) { + margin-inline-start: -13px; + margin-top: -2px; +} + +menupopup[customoptionstyling="true"] { + appearance: none; + padding-block: 0; +} |