Skip to content

Instantly share code, notes, and snippets.

@pythoninthegrass
Created June 9, 2020 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pythoninthegrass/b45e9dd14eb0068bf4ccc96e649093a0 to your computer and use it in GitHub Desktop.
Save pythoninthegrass/b45e9dd14eb0068bf4ccc96e649093a0 to your computer and use it in GitHub Desktop.
Fix Firefox 77's ridiculous URL bar and some other QOL items
/*** Megabar Styler General - version 2020-04-19 ***/
/* SOURCES:
https: //www.userchrome.org/megabar-styling-firefox-address-bar.html
https: //www.userchrome.org/how-create-userchrome-css.html */
/*** General Preferences ***/
:root {
/* Number of pixels of enlargement when URL bar is focused */
--mbarstyler-popout-pixels: 0px;
/* [0px - 7px] */
/* Top Bar Display or Not */
--mbarstyler-top-bar-display: none;
/* [block,none] */
/* Font sizes (default: 13.8px for title, 10.2px for URL) */
--mbarstyler-title-font-size: 15px;
/* [13px - 18px] */
--mbarstyler-url-font-size: 13px;
/* [12px - 16px] */
/* Rows to show without scrolling */
--mbarstyler-max-rows-without-scrolling: 10;
/* Bottom border for each result row */
--mbarstyler-bottom-border-width: 0px;
/* [0px or 1px] */
/* Match display style */
--mbarstyler-match-weight: 700;
/* [400,700] */
--mbarstyler-match-background-opacity: 0;
/* [0.0,0.05,0.1] */
}
/*** URL bar enlargement or lack thereof ***/
/* Compute new position, width, and padding */
#urlbar[breakout][breakout-extend] {
top: calc(5px - var(--mbarstyler-popout-pixels)) !important;
left: calc(0px - var(--mbarstyler-popout-pixels)) !important;
width: calc(100% + (2 * var(--mbarstyler-popout-pixels))) !important;
padding: var(--mbarstyler-popout-pixels) !important;
}
[uidensity="compact"] #urlbar[breakout][breakout-extend] {
top: calc(3px - var(--mbarstyler-popout-pixels)) !important;
}
[uidensity="touch"] #urlbar[breakout][breakout-extend] {
top: calc(4px - var(--mbarstyler-popout-pixels)) !important;
}
/* Prevent shift of URL bar contents */
#urlbar[breakout][breakout-extend] > #urlbar-input-container {
height: var(--urlbar-height) !important;
padding: 0 !important;
}
/* Do not animate */
#urlbar[breakout][breakout-extend] > #urlbar-background {
animation: none !important;
}
/* Remove shadows */
#urlbar[breakout][breakout-extend] > #urlbar-background {
box-shadow: none !important;
}
/*** Top "Blue Bar" Display ***/
.urlbarView-row:first-of-type {
display: var(--mbarstyler-top-bar-display) !important;
}
/*** Font Sizes and Scrolling ***/
/* Title font-size */
.urlbarView-row .urlbarView-title {
font-size: var(--mbarstyler-title-font-size) !important;
}
/* URL / action font-size */
.urlbarView-row .urlbarView-secondary,
.urlbarView-row .urlbarView-url,
.urlbarView-row .urlbarView-action {
font-size: var(--mbarstyler-url-font-size) !important;
}
/* Set max-height for items visible without scrolling */
#urlbarView-results,
#urlbar-results {
height: unset !important;
max-height: calc(
2.5 *
(
var(--mbarstyler-title-font-size) +
var(--mbarstyler-bottom-border-width)
) * var(--mbarstyler-max-rows-without-scrolling)
) !important;
}
#urlbar-results {
overflow-y: auto !important;
}
/* Clean up extra spacing at the top and bottom */
#urlbar-results {
padding-top: 0 !important;
padding-bottom: 0 !important;
}
/* Subtle border between results */
.urlbarView-row:not(:last-of-type) {
border-bottom: var(--mbarstyler-bottom-border-width) solid
rgba(0, 0, 0, 0.1) !important;
}
/* Match Styling Like Fx43-47 */
[lwt-popup-darktext] .urlbarView-row:not([selected]) .urlbarView-title strong,
[lwt-popup-darktext] .urlbarView-row:not([selected]) .urlbarView-url strong {
font-weight: var(--mbarstyler-match-weight) !important;
box-shadow: inset 0 0 1px 1px
rgba(0, 0, 0, calc(var(--mbarstyler-match-background-opacity) * 2));
background-color: rgba(0, 0, 0, var(--mbarstyler-match-background-opacity));
border-radius: 2px;
}
[lwt-popup-brighttext] .urlbarView-row:not([selected]) .urlbarView-title strong,
[lwt-popup-brighttext] .urlbarView-row:not([selected]) .urlbarView-url strong {
font-weight: var(--mbarstyler-match-weight) !important;
box-shadow: inset 0 0 1px 1px
rgba(
255,
255,
255,
calc(var(--mbarstyler-match-background-opacity) * 2)
);
background-color: rgba(
255,
255,
255,
var(--mbarstyler-match-background-opacity)
);
border-radius: 2px;
}
/*** End of: Megabar Styler General ***/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment