Giter Site home page Giter Site logo

Comments (3)

LCweb-ita avatar LCweb-ita commented on May 31, 2024

Hi, thanks for the suggestion, but I'd like to understand better pro sides of this.

Since field status changes are reflected in real time and original checkbox is always kept (but hidden), don't see any advantage of copying (then doubling) classes also on switch.

from lc-switch.

 avatar commented on May 31, 2024

I have many options and for each option, there are 2 categories. So, I decide to do UX like this.

                              Notification1                    Notification2

Option 1 On/Off On/Off

Option 2 On/Off On/Off

etc..

So, i need to give style to each elements. I tried by putting the style on input element assuming the common behaviors of widgets. Obviously, it didn't work out. I had to select the element in css like this
div.lcs_wrap:nth-child(1){
float: left;
width: 200px;
}
div.lcs_wrap:last-child(2){
float: left;
}

I hope you got me.

from lc-switch.

LCweb-ita avatar LCweb-ita commented on May 31, 2024

Being a styling matter: wouldn't be cleaner to wrap those fields with differengt elements?

<div class="row1"><input type="checkbox" /></div>
<div class="row1"><input type="checkbox" /></div>

<div class="row2"><input type="checkbox" /></div>
<div class="row2"><input type="checkbox" /></div>

I use prefer to not add custom CSS to switches and use a similar solution in my WP plugins.
Doubling classes is never a good idea in my opinion. Maybe a custom attribute to set custom classes to switch wrapper would be better, what do you think?

from lc-switch.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.