Skip to content

Instantly share code, notes, and snippets.

@black7375
Last active January 30, 2023 20:23
Show Gist options
  • Save black7375/8dc5513132c714bd3b0f87cb5dfbc135 to your computer and use it in GitHub Desktop.
Save black7375/8dc5513132c714bd3b0f87cb5dfbc135 to your computer and use it in GitHub Desktop.
Firefox Proton's compact, touch
/* Each Mode - Reduce Padding */
/** Variable Compact General Touch
* --tab-min-height 29px 36px 41px
* --toolbarbutton-outter-padding 3px 2px 2px
* --toolbarbutton-inner-padding 6px 8px 9px
* --bookmark-block-padding 1px 4px 7px
* --urlbar-min-height 26px 32px 41px
* --urlbar-icon-padding 3px 6px 7px
* .tab-content[pinned] padding 0 --inline-tab-padding; 0 10px; 0 10px
**/
/* Original Tabbar
https://github.com/mozilla/gecko-dev/blob/master/browser/themes/shared/tabs.inc.css
*/
:root[uidensity=compact] {
--tab-min-height: 29px; /* Compact: 29px, General: 36, Touch: 41px */
}
:root[uidensity=touch] {
--tab-min-height: 41px;
}
:root:not([uidensity=compact]) .tab-content[pinned] {
padding: 0 10px; /* Commpact: 0 var(--inline-tab-padding), [General, Touch]: 0 10px */
}
:root[uidensity=compact] .tab-icon-stack@tabIndicatorReplacesIcon@ > :not(.tab-icon-overlay),
:root:not([uidensity=compact]) #tabbrowser-tabs:not([secondarytext-unsupported]) .tabbrowser-tab:not(:hover) .tab-icon-overlay@tabIndicatorReplacesIcon@,
:root:not([uidensity=compact]) #tabbrowser-tabs:not([secondarytext-unsupported]) .tabbrowser-tab:hover .tab-icon-stack@tabIndicatorReplacesIcon@ > :not(.tab-icon-overlay) {
opacity: 0;
}
/* Original toolbar
https://github.com/mozilla/gecko-dev/blob/master/browser/themes/shared/toolbarbuttons.inc.css
*/
:root[uidensity=compact] {
--toolbarbutton-outer-padding: 3px; /* Compact: 3px, [General, Touch]: 2px */
--toolbarbutton-inner-padding: 6px; /* Compact: 6px, General: 8px, Touch: 9px */
--bookmark-block-padding: 1px; /* Compact: 1px, General: 4px, Touch: 7px */
}
:root[uidensity=touch] {
--toolbarbutton-inner-padding: 9px;
--bookmark-block-padding: 7px;
}
:root[uidensity=compact] findbar toolbarbutton.tabbable:-moz-focusring,
:root[uidensity=compact] toolbar:not(#PersonalToolbar) .toolbarbutton-1:-moz-focusring > .toolbarbutton-icon,
:root[uidensity=compact] toolbar:not(#PersonalToolbar) .toolbarbutton-1:-moz-focusring > .toolbarbutton-text,
:root[uidensity=compact] toolbar:not(#PersonalToolbar) .toolbarbutton-1:-moz-focusring > .toolbarbutton-badge-stack {
outline-offset: calc(var(--focus-outline-width) * -1 - 1px); /* Compact: calc(var(--focus-outline-width) * -1 -1px), [General, Touch]: calc(var(--focus-outline-width) * -1) */
}
:root[uidensity=compact] #PersonalToolbar .toolbarbutton-1,
:root[uidensity=compact] toolbarbutton.bookmark-item:not(.subviewbutton) {
margin-inline: 1px; /* Compact: 1px, [General, Touch]: 2px */
}
root[uidensity=compact] .toolbarbutton-badge {
margin-inline-end: -7px !important; /* Comapct: -7px, [General, Touch]: -8px */
}
:root[uidensity=touch] #PersonalToolbar .toolbarbutton-badge {
margin-top: -4px !important;
}
/* Original Tabbrowser */
/* https://github.com/mozilla/gecko-dev/blob/master/browser/base/content/tabbrowser.css */
:root[uidensity=compact] .tab-secondary-label {
display: none;
}
/* Original Browser */
/* https://github.com/mozilla/gecko-dev/blob/master/browser/themes/shared/browser.inc.css */
:root[uidensity=compact] {
--urlbar-min-height: 26px; /* Compact: 26px, General: 32px, Touch: 34px */
--urlbar-icon-padding: 3px; /* (var(--urlbar-min-height) - 2px border - 2px padding - 16px icon) / 2 | Commpact: 3px, General: 6px, Touch: 7px */
}
:root[uidensity=touch] {
--urlbar-min-height: 34px;
--urlbar-icon-padding: 7px;
}
:root[uidensity=compact] #PersonalToolbar {
padding-inline: 2px; /* Compact: 2px, [General, Touch]: 6px */
}
/* Original URLBar */
/* https://github.com/mozilla/gecko-dev/blob/master/browser/themes/shared/urlbarView.inc.css */
:root:not([uidensity=compact]) .urlbarView-row:not([type=tip], [type=dynamic]) {
min-height: 32px; /* Compact: 32px */
}
:root[uidensity=compact] .urlbarView-row:is([type=switchtab], [type=remotetab]) > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-action {
padding: 3px 6px;
margin-block: -3px;
}
:root[uidensity=touch] .urlbarView-row:not([type=tip], [type=dynamic]) {
padding-block: 11px;
}
:root[uidensity=touch] #urlbar .search-one-offs:not([hidden]) {
padding-block: 11px;
}
/* Original panelUI */
/* https://github.com/mozilla/gecko-dev/blob/master/browser/themes/shared/customizableui/panelUI.inc.css */
/* Original urlbar-searchbar */
/* https://github.com/mozilla/gecko-dev/blob/master/browser/themes/shared/urlbar-searchbar.inc.css */
:root[uidensity=compact] .urlbar-icon {
margin-inline: 1px;
}
:root[uidensity=touch] #urlbar-container,
:root[uidensity=touch] #search-container {
padding-block: 5px;
}
/* Original SideBar */
/* https://github.com/mozilla/gecko-dev/blob/master/browser/themes/linux/places/sidebar.css
https://github.com/mozilla/gecko-dev/blob/master/browser/themes/osx/places/sidebar.css
https://github.com/mozilla/gecko-dev/blob/master/browser/themes/windows/places/sidebar.css
*/
/* Linux */
:root[uidensity=touch] #search-box,
:root[uidensity=touch] .sidebar-placesTreechildren::-moz-tree-row {
min-height: 32px;
}
/* OS X */
:root[uidensity=touch] .sidebar-placesTreechildren::-moz-tree-row {
min-height: 32px;
}
/* Windows */
:root[uidensity=touch] #search-box,
:root[uidensity=touch] .sidebar-placesTreechildren::-moz-tree-row {
min-height: 32px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment