Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other icons for switches #2282

Closed
2 tasks done
Dorian-Grim opened this issue Oct 5, 2023 · 4 comments
Closed
2 tasks done

Other icons for switches #2282

Dorian-Grim opened this issue Oct 5, 2023 · 4 comments

Comments

@Dorian-Grim
Copy link

Dorian-Grim commented Oct 5, 2023

Prerequisites

Proposal

  • Add the ability to change icons on switches without using custom css, dirrectly from HTML either through class or with attributes, data-toggle-on="" data-toggle-off="". Currently we only have
    image
<div class="form-check form-switch">
  <input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckDefault">
  <label class="form-check-label" for="flexSwitchCheckDefault">Default switch checkbox input</label>
</div>
<div class="form-check form-switch">
  <input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckChecked" checked>
  <label class="form-check-label" for="flexSwitchCheckChecked">Checked switch checkbox input</label>
</div>
<div class="form-check form-switch">
  <input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckDisabled" disabled>
  <label class="form-check-label" for="flexSwitchCheckDisabled">Disabled switch checkbox input</label>
</div>
<div class="form-check form-switch">
  <input class="form-check-input" type="checkbox" role="switch" id="flexSwitchCheckCheckedDisabled" checked disabled>
  <label class="form-check-label" for="flexSwitchCheckCheckedDisabled">Disabled checked switch checkbox input</label>
</div>

with no other possible way of editing, except custom css. At least as I currently understand it

Motivation and context

  • there are scenarios where I need other icons for my toggles
@julien-deramond
Copy link
Contributor

Thanks for opening this issue @Dorian-Grim
Could you please share maybe a screenshot of the toggles you'd like to use? Just out of curiosity to see if some things could be integrated into ODS, or are maybe missing.

@julien-deramond
Copy link
Contributor

dirrectly from HTML either through class or with attributes, data-toggle-on="" data-toggle-off=""

We won't add any data-bs-toggle-{on|off} to this component because it would mean adding some JavaScript for a basic HTML component.

I've tested some things quickly, and changing the icons can be done directly in the HTML through CSS variables as shown in https://stackblitz.com/edit/xqddyb?file=index.html.
Note that they can be changed inline with the style="" attribute too when added for the <input> HTML element.

@julien-deramond julien-deramond changed the title other icons for https://boosted.orange.com/docs/5.3/forms/checks-radios/#switches Other icons for switches Oct 5, 2023
@Dorian-Grim
Copy link
Author

dirrectly from HTML either through class or with attributes, data-toggle-on="" data-toggle-off=""

We won't add any data-bs-toggle-{on|off} to this component because it would mean adding some JavaScript for a basic HTML component.

I've tested some things quickly, and changing the icons can be done directly in the HTML through CSS variables as shown in https://stackblitz.com/edit/xqddyb?file=index.html. Note that they can be changed inline with the style="" attribute too when added for the <input> HTML element.

I get your point. Works like this, I knew obv. But specifically this I am trying to avoid.

I don't mind if you close this as is, your decision.

@github-actions
Copy link
Contributor

As the issue was labeled with awaiting-reply, but there has been no response in 14 days, this issue will be closed. If you have any questions, you can comment/reply.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants