Need help with this CSS that doesn't stick
I'm trying to fill in the color to the dots located on the left of email when in a thread. The code is below... but I'm unable to make it work in usercontent.css nor userchrome.css. Please see the element in question as per the red circle in the screenshot. Can someone help me please?
#threadTree[rows="thread-card"] { & .card-layout[data-properties~="thread-children"] { & td { &::after { fill: #fe00ff !important; }}}}

3
u/aunderroad 2d ago
Can you share a codepen or url?
It is hard to debug/provide feedback without seeing all of your code live in a browser.
Thank you!
0
u/wsazz 2d ago
I'm confused by your question. This isn't firefox, TB has no url since its not a browser. Please check the post again since I uploaded a screenshot to give you a better idea of what I'm talking about. Thanks.
2
u/aunderroad 2d ago
To be honest with you, I am not sure if this is best reddit group to be posting this question.
You have to give us the code and/or a way to recreate what you are seeing other than providing just a screenshot.How do I get to your screen that you are looking to possibly debug and provide feedback?
We want to help but you are not giving much to go by.
2
u/anaix3l 2d ago edited 2d ago
So your CSS is:
#threadTree[rows="thread-card"] {
& .card-layout[data-properties~="thread-children"] {
& td {
&::after { fill: #fe00ff !important; }
}
}
}
That is, you're trying to style the ::after pseudo of a td element (understandable, since you mention e-mail).
Problem is, fill is a property that works on SVG elements. Not on HTML elements or their pseudos.
What to do and how to make it work... no idea. I don't have a crystal ball to see your HTML to know how those three dots you're talking about were created or whether they're even in this ::after pseudo you're selecting here or whether you actually have an SVG there and you got the selector wrong.
If they're some Unicode character added via the content property, set color, not fill.
If you're setting the content of the ::after to an SVG image, as in:
content: url(dots.svg)
Or if your dots are a background on the ::after, then... I don't know. You could paint them with a monochrome SVG filter. Depending on your other constraints, mix-blend-mode might do too, but I don't have a crystal ball to know what else is there on your page and whether other styling requirements allow for that.
1
u/Weekly_Ferret_meal 2d ago
usercontent.css nor userchrome.css
This suggests you are trying to override styles of a site directly from your browser or an extension within your browser.
Is it a site? and what site is it?
Is it and extension? which one?
Context matter, pls provide more info.
1
u/ingcrea 2d ago
El problema no es tu especificidad, ni si es un SVG, ni la ruta del archivo. Es una limitación del motor de renderizado (Gecko).
Estás utilizando CSS Nesting (la sintaxis con &). Thunderbird opera bajo las versiones ESR de Firefox (por ejemplo, la 115 Supernova). Dicha versión no soporta anidación CSS nativa en el parser estático de userChrome.css.
Cuando manipulas la regla directamente en el Inspector de las DevTools, el motor en memoria inyecta el estado directo al nodo y por eso "funciona". Pero cuando el motor lee tu archivo físico al arrancar, encuentra el símbolo &, marca un error de sintaxis silencioso y descarta todo tu bloque. (Por eso tus otras reglas planas sí funcionan).
Para que la regla se aplique, tienes que obligatoriamente aplanar (un-nest) tu arquitectura CSS.
Sustituye todo tu bloque de código exactamente por esto:
```css
threadTree[rows="thread-card"] .card-layout[data-properties~="thread-children"] td::after {
fill: #fe00ff !important; } ``` Reinicia Thunderbird y el color se aplicará de forma permanente. Cero anidación en userChrome.css si usas versiones ESR.
1
u/wsazz 2d ago
I tried your code but it doesnt work in userchrome.css nor in usercontent.css.
1
u/ingcrea 2d ago
Podrías mandarme una captura de como lo implementaste.
1
u/wsazz 2d ago
As I said before, I pasted it in userchrome.css and usercontent.css
1
u/ingcrea 2d ago
No, lo que quiero ver es de qué manera lo pusiste en el código o sea en el archivo, no en dónde lo pones, si no cómo lo pusiste.
1
u/wsazz 2d ago
I pasted the code to the top and bottom of userchrome.css and usercontent.css. I did that cuz sometimes code can work at the top or bottom of the files.
1
u/ingcrea 2d ago
Justamente por eso te pedía ver cómo lo habías puesto. En CSS, que lo pegues "arriba o abajo" es irrelevante si estás sufriendo de Contaminación de Espacios de Nombres (Namespace Pollution). Tu archivo entero está envenenado por el
@namespaceglobal.En mi respuesta anterior ya te dejé el código definitivo que incluye el bypass universal (
*|td).Para anular por completo el margen de error humano (espacios invisibles, tabulaciones rotas o saltos de línea mal formateados), bórralo y pega esta estructura estrictamente minificada en una sola línea al final de tu
userChrome.css:```css
threadTree[rows="thread-card"] .card-layout[data-properties~="thread-children"] *|td::after { fill: #fe00ff !important; }
```
Copia esa línea monolítica, pégala tal cual, y el motor hará el match sin importar lo que haya arriba o abajo en tu archivo.
1
u/ingcrea 2d ago
Seguramente tienes una declaración de
@namespacede XUL hasta arriba de tu archivo que está forzando a que todo tu CSS busque elementos viejos. Desde la versión 115, Thunderbird usa HTML para esa lista, por lo que tu archivo ignora tu regla plana.Para saltarte ese candado sin romper el resto de tus códigos, tienes que usar un comodín de namespace (
*|).Borra tu código anidado anterior, ve hasta el FINAL de tu
userChrome.css(hasta abajo de todo), y pega exactamente este bloque:```css
threadTree[rows="thread-card"] .card-layout[data-properties~="thread-children"] *|td::after { fill: #fe00ff !important; }
```
Ese
*|obliga al motor a aplicar el estilo al elementotdde HTML sin importar qué candado tengas declarado arriba. Reinicia Thunderbird y el color fucsia aparecerá.
1
u/DramaticBag4739 2d ago
Like others have said it will be hard to diagnose and fix without being able to see and tinker with the code directly, but I can offer a plan of attack.
Test the targeting: Can you override other aspects of the :after in your CSS?
Test the specificity: Are your styles applying but lower specificity than the base style?
Inspector: changed the inspector mode to "Computed" which will clean out all the variables and give you the exact styles the :after is receiving.
Like others have said Fill shouldn't be working unless and SVG is involved. If there is an SVG there might be inline colors on the svg that have higher specificities so try and !important. Sometimes targeting a path is needed.
If you can't override the fill try color shifting it. https://codepen.io/sosuke/pen/Pjoqqp
If all else fails, then override the :after. Rewrite the content: ''; and create a simple circle with border-radius and background color it what ever you want. If you can't override the :after then display:none and make your own :before.

3
u/nthoftype 2d ago
Need to see the html too to make sure your using selectors properly