0

On inspecting a webpage, I found an HTML element of interest, and looked at its css style properties below.

.Node-bullet:before {
    font-family: "IcoMoon", sans-serif;
    font-size: 16px;
    content: "\e90d";
}

I am trying to use stylish (chrome plugin) to overwrite that CSS.

.Node-bullet:before[content="\e90d"]{
    content: none !important;   
}

Its not working unfortunately. Is there a way to specifically search for a CSS class with an existing attribute[content], filter its value [\e90d], and overwrite it?

I know this is not efficient for production-level sites, I'm simply modifying my notetaking app client-side. I've tried looking at other selectors like descendent but I can't seem to find an easy pattern

EDIT

Overall HTML structure looks like this:

<div class="Node-self">
  <div class="Node-bullet">
  ::before <!-- SELECT THIS -->
  ::after
  </div>
</div>

<div class="Node-self is-collapsed">
  <div class="Node-bullet">
  ::before <!--DO NOT SELECT THIS -->
  ::after
  </div>
</div>
7
  • Content is not actually an attribute to the element. If it were, you would be able to select using it. Having said that, I do not see any reason why the selector .Node-bullet:before shouldn't work fine in this case. Commented Nov 11, 2017 at 16:09
  • what is content called then Commented Nov 11, 2017 at 16:11
  • @Kagerjay It is a CSS property. Commented Nov 11, 2017 at 16:13
  • 1
    .Node-bullet:before{ content: none !important; } can you please ry this. Commented Nov 11, 2017 at 16:13
  • @msz I have that already, but I'm trying to not target the same CSS class with a different content value Commented Nov 11, 2017 at 16:14

2 Answers 2

1

content is a property, before a selector: you can not mix them.

For example you can find all anchor with attribute target _blank, but not with specific "content" or "background".

a[target=_blank] {
}
Sign up to request clarification or add additional context in comments.

Comments

0

Not the specific answer to this problem, but the answer to the overall issue I had using a NOT with a descendent selector

.Node-self:not(.is-collapsed)>.Node-bullet:before{
    content: none !important;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.