diff --git a/themes/72f8f48d-86b9-4487-acea-eb4977b18f21/chrome.css b/themes/72f8f48d-86b9-4487-acea-eb4977b18f21/chrome.css index 3f889feac..ea88f41b0 100644 --- a/themes/72f8f48d-86b9-4487-acea-eb4977b18f21/chrome.css +++ b/themes/72f8f48d-86b9-4487-acea-eb4977b18f21/chrome.css @@ -3,44 +3,68 @@ * Re-style and add customization options for the Ctrl+Tab panel. * Pontus Sundén */ + @-moz-document url-prefix("chrome:") { :root { /** - --psu-better_ctrltab-roundness: 50px; - --psu-better_ctrltab-padding: 35px; - --psu-better_ctrltab-zoom: .8; + --psu-better_ctrltab-roundness: 40px; + + --psu-better_ctrltab-padding: 25px; + --psu-better_ctrltab-background: light-dark(rgba(146, 145, 144, 0.94), rgba(24, 23, 22, 0.94)); + --psu-better_ctrltab-shadow_size: 15px; + --psu-better_ctrltab-panel_border_color: transparent; + --psu-better_ctrltab-panel_border_width: 0px; - --psu-better_ctrltab-background: light-dark(rgba(146, 145, 144, 0.94), rgba(24, 23, 22, 0.94)); - --psu-better_ctrltab-shadow_size: 20px; + --psu-better_ctrltab-panel_maxwidth: 2000px; + --psu-better_ctrltab-panel_vertical_position: -50px; - --psu-better_ctrltab-preview_padding: 30px; - --psu-better_ctrltab-preview_border_width: 1px; - --psu-better_ctrltab-preview_border_color: light-dark(rgba(253, 255, 254, 0.1), rgba(83, 82, 79, 0.2)); - --psu-better_ctrltab-preview_focus_background: light-dark(rgba(77, 76, 78, 0.8), rgba(184, 185, 183, 0.18)); + --psu-better_ctrltab-preview_focus_background: light-dark(rgba(77, 76, 78, 0.8), rgba(184, 185, 183, 0.3)); + + --psu-better_ctrltab-preview_padding: 20px; + --psu-better_ctrltab-preview_border_color: light-dark(rgba(253, 255, 254, 0.1), rgba(83, 82, 79, 0.2)); + --psu-better_ctrltab-preview_border_width: 1px; + + --psu-better_ctrltab-preview_text_color: inherit; --psu-better_ctrltab-preview_font_size: 13px; - --psu-better_ctrltab-preview_letter_spacing: 0px; + --psu-better_ctrltab-preview_font_family: inherit; + --psu-better_ctrltab-preview_font_weight: inherit; + --psu-better_ctrltab-preview_label_overflow: 0.5; + --psu-better_ctrltab-preview_letter_spacing: 0px; - --psu-better_ctrltab-preview_favicon_size: 36px; + --psu-better_ctrltab-preview_favicon_size: 36px; --psu-better_ctrltab-preview_favicon_outdent: 12px; + --psu-better_ctrltab-preview_favicon_background: transparent; + --psu-better_ctrltab-preview_favicon_padding: 2px; /**/ /* helpers */ - --psu-zoom-invert: pow(var(--psu-better_ctrltab-zoom), -1); - --psu-roundness-zoomed: calc(var(--psu-better_ctrltab-roundness) * var(--psu-better_ctrltab-zoom)); + --psu-bct-favicon-size: calc(var(--psu-better_ctrltab-preview_favicon_size) + var(--psu-better_ctrltab-preview_favicon_padding) * 2); + --psu-bct-preview-roundness: calc(var(--psu-better_ctrltab-roundness) * 0.8); + --psu-bct-canvas-roundness: calc(var(--psu-bct-preview-roundness) * 0.8 - var(--psu-better_ctrltab-preview_padding) * 0.33); + --psu-bct-canvas-aspect-ratio: calc(250/170); + --psu-bct-horizontal-padding: calc(var(--psu-better_ctrltab-padding) * 1.1); + --psu-bct-panel-margin: var(--psu-better_ctrltab-shadow_size); + --psu-bct-panel-shadow-color: rgba(1, 1, 4, 0.2); + --psu-bct-label-margin: calc((var(--psu-better_ctrltab-preview_border_width) + var(--psu-better_ctrltab-preview_padding)) * var(--psu-better_ctrltab-preview_label_overflow) * -1); } #ctrlTab-panel { - /* panel styling */ - --panel-border-radius: var(--psu-roundness-zoomed) !important; - --panel-shadow: 0 0 var(--psu-better_ctrltab-shadow_size) calc(var(--psu-better_ctrltab-shadow_size) / 3) rgba(1, 1, 4, 0.2) !important; - --panel-background: var(--psu-better_ctrltab-background) !important; - --panel-padding: 0 !important; + /* reset */ + --panel-background: none !important; + --panel-shadow: none !important; + --panel-border-color: none !important; + --panel-shadow-margin: 0 !important; margin: 0 !important; padding: 0 !important; background-color: unset !important; - /* panel zoom adjust size */ - --psu-default_spacing: 10%; + /* panel */ + margin-top: var(--psu-better_ctrltab-panel_vertical_position) !important; + --panel-color: var(--psu-better_ctrltab-preview_text_color) !important; + --panel-border-radius: var(--psu-better_ctrltab-roundness) !important; + --panel-padding: calc(var(--psu-bct-panel-margin) * 1.5) var(--psu-bct-panel-margin) !important; + + /* conunt items */ --psu-tile-counter: 0; &:has(.ctrlTab-preview:nth-child(1):not([hidden])) { --psu-tile-counter: 1; @@ -62,32 +86,40 @@ } &:has(.ctrlTab-preview:nth-child(7):not([hidden])) { --psu-tile-counter: 7; - --psu-default_spacing: 7%; } - --panel-shadow-margin: var(--psu-better_ctrltab-shadow_size) - calc( - /* decrease by default non-css space */ var(--psu-default_spacing) + (90% - var(--psu-default_spacing)) / 2 * (1 - var(--psu-better_ctrltab-zoom)) - - ( - /* increase by tile padding and borders */ ((var(--psu-better_ctrltab-preview_padding) * 2 + var(--psu-better_ctrltab-preview_border_width) * 2) * var(--psu-tile-counter)) / 2 - /* increase by panel padding */ + (var(--psu-better_ctrltab-padding) * 0.8) - ) * var(--psu-better_ctrltab-zoom) - ) !important; + + /* reverese engineer important measurements */ + --psu-bct-panel-width: min(var(--psu-tile-counter) * 311.25px, var(--psu-better_ctrltab-panel_maxwidth)); + --psu-bct-preview-width: calc( + ((var(--psu-bct-panel-width) - var(--psu-bct-panel-margin) * 2 - var(--psu-bct-horizontal-padding) * 2 - var(--psu-better_ctrltab-panel_border_width) * 2) / var(--psu-tile-counter)) - + var(--psu-better_ctrltab-preview_padding) * 2 - var(--psu-better_ctrltab-preview_border_width) * 2 + ); + --psu-bct-preview-height: calc(var(--psu-bct-preview-width) / var(--psu-bct-canvas-aspect-ratio)); + --psu-bct-panel-height: calc( + var(--psu-bct-preview-height) + var(--psu-better_ctrltab-panel_border_width) * 2 + var(--psu-better_ctrltab-padding) * 2 + var(--psu-better_ctrltab-preview_padding) * 2 + + var(--psu-better_ctrltab-preview_border_width) * 2 + var(--psu-better_ctrltab-preview_font_size) + ); #ctrlTab-previews { - /* panel zoom and padding*/ - zoom: var(--psu-better_ctrltab-zoom) !important; - padding: var(--psu-better_ctrltab-padding) calc(var(--psu-better_ctrltab-padding) * 0.8) !important; + margin: 0 auto !important; + padding: var(--psu-better_ctrltab-padding) var(--psu-bct-horizontal-padding) !important; + background: var(--psu-better_ctrltab-background) !important; + border-radius: var(--psu-better_ctrltab-roundness) !important; + box-shadow: 0 0 var(--psu-better_ctrltab-shadow_size) calc(var(--psu-better_ctrltab-shadow_size) / 3) var(--psu-bct-panel-shadow-color) !important; + border-style: solid; + border-color: var(--psu-better_ctrltab-panel_border_color); + border-width: var(--psu-better_ctrltab-panel_border_width); .ctrlTab-preview { margin: 0 !important; padding: 0 !important; - border-radius: calc(var(--psu-roundness-zoomed) * 0.8) !important; + border-radius: var(--psu-bct-preview-roundness) !important; /* previews styling */ .ctrlTab-preview-inner { margin: 0 !important; padding: calc(var(--psu-better_ctrltab-preview_padding) + var(--psu-better_ctrltab-preview_border_width)) !important; - border-radius: calc(var(--psu-roundness-zoomed) * 0.8) !important; + border-radius: var(--psu-bct-preview-roundness) !important; padding-bottom: calc(var(--psu-better_ctrltab-preview_padding) / 2) !important; border: none !important; text-shadow: 0.5px 0.5px 0px light-dark(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)); @@ -99,31 +131,37 @@ .ctrlTab-canvas, img, canvas { - border-radius: calc(var(--psu-roundness-zoomed) * 0.25) !important; + border-radius: var(--psu-bct-canvas-roundness) !important; + height: var(--psu-bct-preview-height) !important; + width: var(--psu-bct-preview-width) !important; } /* label styling */ .ctrlTab-label { - font-size: calc(var(--psu-better_ctrltab-preview_font_size) * var(--psu-zoom-invert)) !important; - letter-spacing: calc(var(--psu-better_ctrltab-preview_letter_spacing) * var(--psu-zoom-invert)); - margin: 0 calc(var(--psu-better_ctrltab-preview_border_width) * -1) !important; + font-size: var(--psu-better_ctrltab-preview_font_size) !important; + letter-spacing: var(--psu-better_ctrltab-preview_letter_spacing) !important; + font-family: var(--psu-better_ctrltab-preview_font_family) !important; + font-weight: var(--psu-better_ctrltab-preview_font_weight) !important; + margin: 0 var(--psu-bct-label-margin) !important; padding: 0 !important; } /* favicon styling and position */ - .ctrlTab-favicon-container image { - height: var(--psu-better_ctrltab-preview_favicon_size) !important; - width: var(--psu-better_ctrltab-preview_favicon_size) !important; - box-shadow: none !important; - background: none !important; - position: absolute !important; - padding: 0 !important; - margin: 0 !important; - margin-right: calc(var(--psu-better_ctrltab-preview_favicon_outdent) * -1) !important; - margin-top: calc( - (var(--psu-better_ctrltab-preview_padding) / 2 + var(--psu-better_ctrltab-preview_border_width)) * -1 - var(--psu-better_ctrltab-preview_favicon_size) + - var(--psu-better_ctrltab-preview_favicon_outdent) * 0.8 - ) !important; + .ctrlTab-favicon-container { + image { + height: var(--psu-bct-favicon-size) !important; + width: var(--psu-bct-favicon-size) !important; + box-shadow: none !important; + background: var(--psu-better_ctrltab-preview_favicon_background) !important; + position: absolute !important; + padding: var(--psu-better_ctrltab-preview_favicon_padding) !important; + margin: 0 !important; + margin-right: calc(var(--psu-better_ctrltab-preview_favicon_outdent) * var(--psu-bct-canvas-aspect-ratio) * -1) !important; + margin-top: calc( + (var(--psu-better_ctrltab-preview_padding) / 2 + var(--psu-better_ctrltab-preview_border_width)) * -1 - var(--psu-bct-favicon-size) + + (var(--psu-better_ctrltab-preview_favicon_outdent) * pow(var(--psu-bct-canvas-aspect-ratio), -1)) + ) !important; + } } /* focused bg styling */ diff --git a/themes/72f8f48d-86b9-4487-acea-eb4977b18f21/preferences.json b/themes/72f8f48d-86b9-4487-acea-eb4977b18f21/preferences.json index a585e5877..0c46e6f97 100644 --- a/themes/72f8f48d-86b9-4487-acea-eb4977b18f21/preferences.json +++ b/themes/72f8f48d-86b9-4487-acea-eb4977b18f21/preferences.json @@ -1,86 +1,156 @@ [ - { - "label": "General - Padding", - "defaultValue": "16px", - "placeholder": "20px", - "property": "psu.better_ctrltab.padding", - "type": "string" - }, - { - "label": "General - Corners Roundness", - "defaultValue": "28px", - "placeholder": "5px", - "property": "psu.better_ctrltab.roundness", - "type": "string" - }, - { - "label": "General - Zoom (1.0 = Full width 0.5 = 25% space on each side)", - "defaultValue": "0.8", - "placeholder": "1.0", - "property": "psu.better_ctrltab.zoom", - "type": "string" - }, - { - "label": "Panel - Background", - "defaultValue": "light-dark(rgba(144, 144, 144, 0.94), rgba(22, 22, 22, 0.92))", - "placeholder": "light-dark(rgba(144,144,144,0.96), rgba(99,99,99,0.96))", - "property": "psu.better_ctrltab.background", - "type": "string" - }, - { - "label": "Panel - Shadow Size", - "defaultValue": "18px", - "placeholder": "10px", - "property": "psu.better_ctrltab.shadow_size", - "type": "string" - }, - { - "label": "Focused Item - Background", - "defaultValue": "light-dark(rgba(77, 77, 77, 0.8), rgba(204, 204, 204, 0.33))", - "placeholder": "light-dark(rgba(77,77,77,0.8), rgba(1,1,1,0.6))", - "property": "psu.better_ctrltab.preview_focus_background", - "type": "string" - }, - { - "label": "Item - Border Color", - "defaultValue": "light-dark(rgba(255, 255, 255, 0.1), rgba(1, 1, 1, 0.1))", - "placeholder": "light-dark(rgba(255,255,255,0.1), rgba(88,88,88,0.6))", - "property": "psu.better_ctrltab.preview_border_color", - "type": "string" - }, - { - "label": "Item - Border Width", - "defaultValue": "1px", - "placeholder": "2px", - "property": "psu.better_ctrltab.preview_border_width", - "type": "string" - }, - { - "label": "Item - Label Font Size", - "defaultValue": "13px", - "placeholder": "11px", - "property": "psu.better_ctrltab.preview_font_size", - "type": "string" - }, - { - "label": "Item - Label Letter Spacing", - "defaultValue": "0px", - "placeholder": "0px", - "property": "psu.better_ctrltab.preview_letter_spacing", - "type": "string" - }, - { - "label": "Item - Favicon Size", - "defaultValue": "36px", - "placeholder": "40px", - "property": "psu.better_ctrltab.preview_favicon_size", - "type": "string" - }, - { - "label": "Item - Favicon Outdent", - "defaultValue": "12px", - "placeholder": "6px", - "property": "psu.better_ctrltab.preview_favicon_outdent", - "type": "string" - } + { + "label": "General - Corners Roundness", + "defaultValue": "40px", + "placeholder": "5px", + "property": "psu.better_ctrltab.roundness", + "type": "string" + }, + { + "label": "Panel - Padding", + "defaultValue": "25px", + "placeholder": "20px", + "property": "psu.better_ctrltab.padding", + "type": "string" + }, + { + "label": "Panel - Background", + "defaultValue": "light-dark(rgba(146, 145, 144, 0.94), rgba(24, 23, 22, 0.94))", + "placeholder": "light-dark(rgba(144,144,144,0.96), rgba(99,99,99,0.96))", + "property": "psu.better_ctrltab.background", + "type": "string" + }, + { + "label": "Panel - Shadow Size", + "defaultValue": "15px", + "placeholder": "10px", + "property": "psu.better_ctrltab.shadow_size", + "type": "string" + }, + { + "label": "Panel - Border Color", + "defaultValue": "transparent", + "placeholder": "light-dark(white, black)", + "property": "psu.better_ctrltab.panel_border_color", + "type": "string" + }, + { + "label": "Panel - Border Width", + "defaultValue": "0px", + "placeholder": "2px", + "property": "psu.better_ctrltab.panel_border_width", + "type": "string" + }, + { + "label": "Panel - Max-width", + "defaultValue": "2000px", + "placeholder": "1600px", + "property": "psu.better_ctrltab.panel_maxwidth", + "type": "string" + }, + { + "label": "Panel - Adjust Vertical Position", + "defaultValue": "-50px", + "placeholder": "-200px", + "property": "psu.better_ctrltab.vertical_position", + "type": "string" + }, + { + "label": "Focused Item - Background", + "defaultValue": "light-dark(rgba(77, 76, 78, 0.8), rgba(184, 185, 183, 0.3))", + "placeholder": "light-dark(rgba(77,77,77,0.8), rgba(1,1,1,0.6))", + "property": "psu.better_ctrltab.preview_focus_background", + "type": "string" + }, + { + "label": "Item - Padding", + "defaultValue": "20px", + "placeholder": "10px", + "property": "psu.better_ctrltab.preview_padding", + "type": "string" + }, + { + "label": "Item - Border Color", + "defaultValue": "light-dark(rgba(253, 255, 254, 0.1), rgba(83, 82, 79, 0.2))", + "placeholder": "light-dark(rgba(255,255,255,0.1), rgba(88,88,88,0.6))", + "property": "psu.better_ctrltab.preview_border_color", + "type": "string" + }, + { + "label": "Item - Border Width", + "defaultValue": "1px", + "placeholder": "2px", + "property": "psu.better_ctrltab.preview_border_width", + "type": "string" + }, + { + "label": "Item Label - Text Color", + "defaultValue": "inherit", + "placeholder": "light-dark(black, white)", + "property": "psu.better_ctrltab.preview_text_color", + "type": "string" + }, + { + "label": "Item Label - Font Size", + "defaultValue": "13px", + "placeholder": "11px", + "property": "psu.better_ctrltab.preview_font_size", + "type": "string" + }, + { + "label": "Item Label - Font Family", + "defaultValue": "inherit", + "placeholder": "Comic Sans", + "property": "psu.better_ctrltab.preview_font_family", + "type": "string" + }, + { + "label": "Item Label - Font Weight", + "defaultValue": "inherit", + "placeholder": "bold", + "property": "psu.better_ctrltab.preview_font_weight", + "type": "string" + }, + { + "label": "Item Label - Overflow (0.7 = Label use 70% of padding)", + "defaultValue": "0.5", + "placeholder": "0.25", + "property": "psu.better_ctrltab.preview_label_overflow", + "type": "string" + }, + { + "label": "Item Label - Letter Spacing", + "defaultValue": "0px", + "placeholder": "-0.5px", + "property": "psu.better_ctrltab.preview_letter_spacing", + "type": "string" + }, + { + "label": "Item Favicon - Size", + "defaultValue": "36px", + "placeholder": "40px", + "property": "psu.better_ctrltab.preview_favicon_size", + "type": "string" + }, + { + "label": "Item Favicon - Outdent", + "defaultValue": "12px", + "placeholder": "6px", + "property": "psu.better_ctrltab.preview_favicon_outdent", + "type": "string" + }, + { + "label": "Item Favicon - Background", + "defaultValue": "transparent", + "placeholder": "light-dark(white, black)", + "property": "psu.better_ctrltab.preview_favicon_background", + "type": "string" + }, + { + "label": "Item Favicon - Padding", + "defaultValue": "2px", + "placeholder": "0px", + "property": "psu.better_ctrltab.preview_favicon_padding", + "type": "string" + } ] \ No newline at end of file