Toggle Switch Not Rendering
-
<div class="mdc-switch"> <div class="mdc-switch__track"></div> <input type="checkbox" class="mdc-switch__native-control" id="my-switch" /> <div class="mdc-switch__thumb-underlay"> <div class="mdc-switch__thumb"></div> </div> </div>
.mdc-switch:not(.mdc-switch--checked) .mdc-switch__track { background-color: var(--md-sys-color-on-surface, #000); }
Above is the switch markup inside a function and what I believe is the CSS for the switch to render instead of a checkbox. I’m only getting a checkbox to show on the front end. What am I missing?
- The topic ‘Toggle Switch Not Rendering’ is closed to new replies.