Code Monkey home page Code Monkey logo

Comments (4)

LeaVerou avatar LeaVerou commented on July 19, 2024

They are, in the CSS. They are used with .token, like .token.comment. I find it highly unlikely that .token.whatever will clash with author styles.

from prism.

necolas avatar necolas commented on July 19, 2024

That doesn't help because you can still end up with specificity problems. All it takes if for someone (e.g. a wordpress user) to have CSS like #comments .comment and then any code in a comment is going to be affected. Hence, either namespace the classes or use !important in the theme CSS.

from prism.

LeaVerou avatar LeaVerou commented on July 19, 2024

can't they get around that by tag qualifying the other code? Prism’s .comments are spans, I doubt WP .comments are.
I really like the sensible class names it currently has (they're one of the 6 advantages listed in the header), so I'm very reluctant to throw this away for the possibility of a collision. After all, if an author wants to customize the token names, it's trivial.

from prism.

necolas avatar necolas commented on July 19, 2024

I don't think you need to throw them away, but it's also sensible to protect your plugin from author styles without relying on them making other changes to their code. Hope you'll consider adding a simple namespace or the option to do so. Thanks

from prism.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.