Namespace/prefix all the classes?
See original GitHub issueAs the Prism can be embedded in different environments, there could be already any of the class names that Prism uses, like tag
, token
, number
etc. So it’s possible that those styles would override or change Prism’s.
The usual way to fix that is to use some prefix for all the classes used in Prism, so we can add the prism-
prefix to all those classes: prism-tag
, prism-token
, prism-number
etc.
I can’t see any serious drawbacks, the gzip would cover neglect all the added prefixes.
Issue Analytics
- State:
- Created 11 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Namespace Prefix | Apex Developer Guide
The Salesforce application supports the use of namespace prefixes . Namespace prefixes are used in managed AppExchange packages to differentiate custom object ...
Read more >apex - Get Namespace Prefix from calling class
Now for all my test class written, I would have set this flag to true IMarkerInterface.RUN_TRIGGER = true; in my test methods, so...
Read more >xml - How to add namespace prefix to class element in c#
Use a XmlSerializerNamespaces as such : var id = new Identification() { DEANumber = "qwe", NPI = 123, }; var serializer = new ......
Read more >Changing Namespace Prefix Properties | Microsoft Learn
You can control namespace prefixes when serializing an XML tree in C# and Visual Basic. To do this, insert attributes that declare namespaces....
Read more >Customization Namespace Prefix (The Java EE 5 Tutorial)
Customization Namespace Prefix. All standard JAXB binding declarations must be preceded by a namespace prefix that maps to the JAXB namespace URI ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Absolutely not. I’m very firm on this one. I’m fed up seeing scripts with awful prefixed class names, making everything uglier just for the off chance there might be a collision.
What we could do, is add
.token
before each class selector, since every token also has this class as well. So.number
would become.token.number
.Hi @jonmilner,
When I said “first complaint I get, I change the selectors”, it was 2012 and Prism had just been released. Now it’s way too late, as it would break tons of sites, plugins, themes etc. Having human readable names was a design decision that I made pretty early on in this project. I knew there was a chance of collision, but the advantages outweighed the disadvantages and there are plenty of workarounds for collisions.
That said, perhaps this can be solved by just prefixing all Prism selectors with "code " so they don’t apply to any random area in the page. Can anyone think of any drawbacks to this?