this post was submitted on 24 Nov 2023
2 points (100.0% liked)

Firefox Customs

64 readers
2 users here now

Chat with us!

Post your unsupported Firefox customizations here!

From the makers of r/FirefoxCSS

Links

Related

Rules

  1. Posts must have flair!
  2. Posts cannot be memes/shitposts. They should be about Firefox customization with CSS.
  3. Please be civil. Bear in mind that many users come here for help and would be turned off by insults and rudeness.
  4. When posting large amount of code use a service dedicated to hosting text snippets, such as pastebin, hastebin, github gist or equivalent. Relatively short snippets can be wrapped in code-block for inline viewing.
  5. Do NOT use url-shorteners or link to compressed downloads (such as zip or rar) when sharing code.

founded 2 years ago
MODERATORS
 

My code is this, I tried different codes but not works.

.tabbrowser-tab::after::last-child{
    content: "" !important;
    display: block;
    height: var(--tab-height-personal) !important;
    width: 130px !important;
    border-bottom: 1px solid blue !important;
    border-image: var(--panel-separator-zap-gradient2) 1 !important;
}
top 2 comments
sorted by: hot top controversial new old
[โ€“] MrOtherGuy 2 points 1 year ago (1 children)

That selector is invalid. :last-child is a pseudo-class there should only be one colon. ::after denotes a pseudo-element but pseudo-elements cannot have any pseudo-classes - or any other attributes for that matter on their own. The way you have wrote the selector sort of implies "an ::after pseudo-element which also has :last-child pseudo-class".

To make it valid you would write it like this .tabbrowser-tab:last-child::after. However, a .tabbrowser-tab will never be a last-child of its parent, because there will always be an after it. Luckily for you the node type of tabs is so then you can use :last-of-type instead of :last-child. Technically it's not the same thing, but probably what you want.

[โ€“] Godie 2 points 1 year ago

Thanks for the explanation, you are a genius. I will use this:

.tabbrowser-tab:last-of-type::after{..}