Make icons more stylable #14990
Unanswered
vaughn-taylor
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm developing a plugin to make styling the CP much more intuitive and simple. I noticed that the display of icons varies greatly: some are inline SVG, and some are using a CSS pseudo selector pointing to an SVG background. Inline SVGs can be much easier to style if they don't rely on classes, but instead use
fill="currentColor"
. By usingcurrentColor
, the icon color can be changed using the CSScolor
property.I've noticed that the most difficult icons to style are in the page preview section; specifically, the desktop, tablet, and mobile icons at the top of the page. These rely on the before pseudo class, and point to background SVGs:
This is not ideal for styling, nor are they ideal for performance because a trip to the server is required. I propose something more like this for the
btngroup
:The SVGs are inlined, so no need to go to the server. The icons are more similar to those found in the rest of the CP in Craft 5. Also, they all use
currentColor
so they are more easily styled. You'll end up with this:Beta Was this translation helpful? Give feedback.
All reactions