Devicon CSS Class Mapping and Language Identifier Interoperability
0 reputation · 20 Mar 2023, 02:35 UTC
Icon Class Resolution for Special Characters
Devicon utilizes a class-based selection pattern devicon-<name>-<style> to render SVG icons. While standard identifiers follow a predictable naming convention, languages containing special characters—such as C++, C#, or .NET—require specific mapping to valid CSS class identifiers.
There is currently an ambiguity regarding how these special characters are transformed into class names. Because CSS classes cannot contain certain symbols, the library must employ a substitution strategy (e.g., replacing "#" or "+" with hyphens or specific keywords) to ensure the icons render correctly.
Without a formal specification for these transformations, developers must rely on trial and error or manual inspection of the library's source CSS to identify the correct class for non-alphanumeric language names.
- What is the documented transformation rule for converting language names with special characters into Devicon CSS classes?
- Is there a consistent mapping pattern for identifiers like "C#" or "C++" across different versions of the library?