- Firefox-Version
- 129.0
- Betriebssystem
- Win10
Hallo community,
An die CSS-Experten:
Könnt Ihr hier mal drüber schauen - es ist ein Codeschnipsel aus einem anderen Forum/Post. - und funktioniert.
Aber ist es auch halbwegs "sauber" programmiert ?? Kann man es so lassen, oder geht es kürzer/suberer/besser?
Eigentlich versuche ich den CSS-Code immer so kurz wie möglich zu halten - möglichst ohne Fehlerrisiko.
(Inhaltlich: Die grüne Hintergrundfarbe (normales https) würde ich wegglassen, weil fast jede URL heutzutage damit "grün" wird = kein Mehrwert)
CSS
#identity-box::before
{
position: absolute;
display: block;
content: "";
width: 100%;
height: var(--urlbar-height);
left: 0;
top: 0;
pointer-events: none;
}
:root[customizing] #identity-box::before,
#urlbar[focused] #identity-box::before { display: none }
#searchbar[focused] #identity-box::before { display: none }
/* https */
/* BEISPIEL: https://www.google.com/ */
#identity-box[pageproxystate="valid"].verifiedDomain::before {
background-color: rgba(147,235,117,0.5) !important; /* GREEN */
box-shadow: inset 0px -2px 0px 1px rgba(155,196,141,0.6), inset 0px 1px 0px 0px rgba(155,196,141,0.6) !important;
}
/*--------------------------------------------------------------------------------------------------------------------*/
/* http: and potentially some other insecure connections like ftp: */
/* http://http.badssl.com/ */
#identity-box[pageproxystate="valid"].certErrorPage::before,
#identity-box[pageproxystate="valid"].notSecure::before {
background-color: rgba(252,78,104,0.53) !important; /* RED */
box-shadow: inset 0px -2px 0px 1px rgba(252,78,104,0.78), inset 0px 1px 0px 0px rgba(252,78,104,0.78) !important;
}
/*--------------------------------------------------------------------------------------------------------------------*/
#identity-box.certErrorPage::before,
#identity-box.notSecure::before {
/* http://http.badssl.com/ */
background-color: rgba(255,255,255,0.53) !important; /* WHITE */
box-shadow: inset 0px -2px 0px 1px rgba(255,255,255,0.1), inset 0px 1px 0px 0px rgba(255,255,255,0.1) !important;
}
/*--------------------------------------------------------------------------------------------------------------------*/
/* Mixed content including neterror */
#identity-box[pageproxystate="valid"].unknownIdentity::before {
/* background-color: rgba(255,235,117,0.53) !important; /* YELLOW */
/* box-shadow: inset 0px -2px 0px 1px rgba(255,235,117,0.68), inset 0px 1px 0px 0px rgba(255,235,117,0.78) !important; */
background-color: rgba(252,78,104,0.53) !important; /* RED */
box-shadow: inset 0px -2px 0px 1px rgba(252,78,104,0.78), inset 0px 1px 0px 0px rgba(252,78,104,0.78) !important;
}
/*--------------------------------------------------------------------------------------------------------------------*/
/* Extension pages */
/* BEISPIEL: addon pages like uBlock Origin Dashboard */
#identity-box[pageproxystate="valid"].extensionPage::before {
background-color: rgba(255,255,255,0.53) !important; /* WHITE */
box-shadow: inset 0px -2px 0px 1px rgba(255,255,255,0.1), inset 0px 1px 0px 0px rgba(255,255,255,0.1) !important;
}
/*--------------------------------------------------------------------------------------------------------------------*/
/* Internal about: and chrome:// urls (includes reader-view) rgba(35,150,250,0.32) */
/* BEISPIEL: about:config */
#identity-box[pageproxystate="valid"].chromeUI::before {
background-color: rgba(255,255,255,0.53) !important; /* WHITE */
box-shadow: inset 0px -2px 0px 1px rgba(255,255,255,0.1), inset 0px 1px 0px 0px rgba(255,255,255,0.1) !important;
}
/*--------------------------------------------------------------------------------------------------------------------*/
#identity-box.localResource::before {
background-color: rgba(255,255,255,0.53) !important; /* WHITE */
box-shadow: inset 0px -2px 0px 1px rgba(255,255,255,0.1), inset 0px 1px 0px 0px rgba(255,255,255,0.1) !important;
}
Alles anzeigen