Looking to incorporate Font Awesome 5.10.2
Duotone icons easily into any HTML element.
The icon element relies on HTML attributes that should correspond to a specific icon, with the mapping controlled by the CSS author.
<x pay></x> <!-- The value of the pay icon can be customized by the CSS author -->
Here is my current solution but I am considering...
Is it possible to minimize
x {
position: relative;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-style: normal;
font-variant: normal;
text-rendering: auto;
white-space: nowrap;
font-family: var(--fa-5-d);
font-weight: var(--fa-d);
background: var(--x-background);
line-height: 1em !important;
}
x::after { position: absolute; left: 0; bottom: 0; }
x::before { color: var(--fa-primary-color, inherit); opacity: 1; opacity: var(--fa-primary-opacity, 1.0); }
x::after { color: var(--fa-secondary-color, inherit); opacity: var(--fa-secondary-opacity, 0.4); }
x:before { --fa-credit-card: "\f09d"; }
x:after { --fa-credit-card: "\10f09d"; }
<x pay></x>
this ↓
x[pay]:before,
x[pay]:after { content: var(--fa-credit-card); }
to this ↓ (eliminating x[pay]:before, x[pay]:after repetition)
x[pay] { --content: var(--fa-credit-card);
basically,
- assign a CSS variable once to a parent with a value v
- that splits into different child values v₁ and v₂ based on v?
?