torCircuitPanel.css (5361B)
1 /* Toolbar button */ 2 3 #tor-circuit-button-icon { 4 width: 16px; 5 height: 16px; 6 /* We want to set flat fill if we have prefers-contrast. Otherwise, we want a 7 * gradient fill depending on the dark mode. 8 * context-fill is insufficient for a linear gradient, so we instead use the 9 * image as a mask and set the <xul:image> background color to the fill we 10 * want. */ 11 mask-image: url("chrome://browser/content/tor-circuit-icon-mask.svg"); 12 mask-origin: content-box; 13 mask-size: cover; 14 mask-position: center; 15 mask-repeat: no-repeat; 16 /* High-Contrast fill. */ 17 background: currentColor; 18 } 19 20 @media not ((prefers-contrast) or (forced-colors)) { 21 #tor-circuit-button-icon { 22 background: linear-gradient(315deg, #008799 0%, #6153c6 50%, #ca00cc 100%); 23 } 24 25 @media (prefers-color-scheme: dark) { 26 #tor-circuit-button-icon { 27 background: linear-gradient(315deg, #4ceaff 0%, #808fff 50%, #fd66ff 100%); 28 } 29 } 30 } 31 32 /* Panel */ 33 34 #tor-circuit-alias, 35 #tor-circuit-node-list-name, 36 .tor-circuit-addresses, 37 .tor-circuit-button-description { 38 color: var(--text-color-deemphasized); 39 } 40 41 #tor-circuit-panel .panel-header { 42 /* .panel-header already inherits these same rules from panelUI-shared.css and 43 * xul.css. But .panel-header is normally "flex-direction: row", but we are 44 * using a vbox (i.e flex-direction: column) so that the heading is placed 45 * vertically above the #tor-circuit-alias when it is shown. We want to 46 * ensure the layout rules we need for our different case so we are less 47 * vulnerable to changes in panelUI-shared.css. */ 48 display: flex; 49 flex-direction: column; 50 align-items: center; 51 justify-content: center; 52 text-align: center; 53 } 54 55 .panel-header > h1#tor-circuit-heading { 56 /* Overwrite rule from panelUI-shared.css which gives this "flex: auto". 57 * Otherwise the heading will be stretched vertically and not be 58 * center-aligned. */ 59 flex: 0 0 auto; 60 } 61 62 #tor-circuit-alias:not([hidden]) { 63 /* Same as padding for .panel-header */ 64 margin-block-start: var(--arrowpanel-menuitem-margin-inline); 65 display: flex; 66 align-items: center; 67 } 68 69 #tor-circuit-alias img { 70 -moz-context-properties: fill; 71 fill: currentColor; 72 width: 14px; 73 height: 14px; 74 flex: 0 0 auto; 75 margin-inline-end: 0.25em; 76 } 77 78 #tor-circuit-alias-label { 79 margin: 0; 80 white-space: nowrap; 81 } 82 83 #tor-circuit-panel-body { 84 /* May grow larger than 480px if we have a long domain name or ip address. */ 85 min-width: 480px; 86 /* Line up with the button at the bottom of the panel. */ 87 margin: var(--arrowpanel-menuitem-margin); 88 padding: var(--arrowpanel-menuitem-padding); 89 gap: var(--arrowpanel-menuitem-padding-block); 90 } 91 92 #tor-circuit-node-list-name, 93 #tor-circuit-node-list { 94 margin: 0; 95 } 96 97 #tor-circuit-node-list { 98 list-style: none; 99 padding-inline-start: var(--arrowpanel-menuitem-margin-inline); 100 /* Do not allow an item to wrap since this would break the circuit diagram. */ 101 white-space: nowrap; 102 } 103 104 .tor-circuit-node-item { 105 /* We want the "bullets" of the list to act as the circuit diagram, and we 106 * also want them to be vertically aligned and scaled to the height of the 107 * list item so that the different parts visually connect. 108 * Using list-style-image does not give us enough control over sizing the 109 * image. So instead we use a background-image. */ 110 padding-inline-start: 1.5em; 111 padding-block: 6px; 112 background-image: url("chrome://browser/content/tor-circuit-node-middle.svg"); 113 -moz-context-properties: fill; 114 /* Light Gray 50 */ 115 fill: rgb(191, 191, 201); 116 background-position-x: right; 117 background-position-y: center; 118 /* Bump the size by small amount to prevent rendering gaps. 119 * We're assuming here that each line will have the same height so that each 120 * image has the same size. */ 121 background-size: auto calc(100% + 0.5px); 122 background-repeat: no-repeat; 123 } 124 125 .tor-circuit-node-item:not([hidden]) { 126 display: flex; 127 align-items: baseline; 128 } 129 130 .tor-circuit-node-item > * { 131 flex: 0 0 auto; 132 } 133 134 @media (prefers-color-scheme: dark) { 135 .tor-circuit-node-item { 136 /* Light Gray 90 */ 137 fill: rgb(128, 128, 142); 138 } 139 } 140 141 .tor-circuit-node-item:dir(ltr) { 142 background-position-x: left; 143 } 144 145 .tor-circuit-node-item#tor-circuit-start-item { 146 background-image: url("chrome://browser/content/tor-circuit-node-start.svg"); 147 } 148 149 .tor-circuit-node-item#tor-circuit-end-item { 150 background-image: url("chrome://browser/content/tor-circuit-node-end.svg"); 151 } 152 153 .tor-circuit-node-item#tor-circuit-relays-item { 154 background-image: url("chrome://browser/content/tor-circuit-node-relays.svg"); 155 } 156 157 .tor-circuit-region-flag { 158 margin-inline-end: 0.5em; 159 height: 16px; 160 align-self: center; 161 /* Don't occupy any vertical height. */ 162 margin-block: -8px; 163 } 164 165 .tor-circuit-region-flag.no-region-flag-src { 166 display: none; 167 } 168 169 .tor-circuit-addresses { 170 /* FIXME: Use a standard font size. Likely will be replaced with the conflux 171 * design. */ 172 /* stylelint-disable-next-line stylelint-plugin-mozilla/use-font-size-tokens */ 173 font-size: 0.9em; 174 font-family: monospace; 175 margin-inline-start: 0.75em; 176 } 177 178 .tor-circuit-ip-address { 179 /* Override the rule for <code>, which is -moz-fixed. */ 180 font-family: inherit; 181 } 182 183 /* Footer buttons */ 184 .tor-circuit-button label { 185 margin: 0; 186 } 187 188 .tor-circuit-button .tor-circuit-button-description { 189 margin-block-start: var(--space-xsmall); 190 }