Giter Site home page Giter Site logo

Sizes about awesome-bootstrap-checkbox HOT 11 CLOSED

flatlogic avatar flatlogic commented on May 18, 2024
Sizes

from awesome-bootstrap-checkbox.

Comments (11)

swrocket avatar swrocket commented on May 18, 2024 3

In case someone wants to try this, I added the following CSS into the CSS file

.checkbox.checkbox-lg label::before{
    width: 30px;
    height: 30px;
}

.checkbox.checkbox-lg label::after{
    width: 30px;
    height: 30px;
    padding-left: 4px;
    font-size: 20px;
}

and then, when I define the element in HTML i add checkbox-lg

from awesome-bootstrap-checkbox.

gandaldf avatar gandaldf commented on May 18, 2024

+1 - I'd need it too!

from awesome-bootstrap-checkbox.

okendoken avatar okendoken commented on May 18, 2024

Guys, thanks for your proposal. We can handle this when there will be free time, but you are very welcome with a Pull Request ;)

from awesome-bootstrap-checkbox.

gandaldf avatar gandaldf commented on May 18, 2024

Here is my solution:

.checkbox.checkbox-sm label::before {
  width: 30px;
  height: 30px;
  top: -13px;
}
.checkbox.checkbox-sm label::after {
  width: 30px;
  height: 30px;
  padding-left: 4px;
  font-size: 20px;
  left: 1px;
  top: -13px;
}
.checkbox.checkbox-sm label {
  padding-left: 18px;
  top: 13px;
}
.checkbox.checkbox-md label::before {
  width: 34px;
  height: 34px;
  top: -17px;
}
.checkbox.checkbox-md label::after {
  width: 34px;
  height: 34px;
  padding-left: 4px;
  font-size: 24px;
  left: 1px;
  top: -18px;
}
.checkbox.checkbox-md label {
  padding-left: 22px;
  top: 17px;
}
.checkbox.checkbox-lg label::before {
  width: 46px;
  height: 46px;
  top: -28px;
}
.checkbox.checkbox-lg label::after {
  width: 46px;
  height: 46px;
  padding-left: 4px;
  font-size: 36px;
  left: 1px;
  top: -31px;
}
.checkbox.checkbox-lg label {
  padding-left: 34px;
  top: 32px;
}

.radio.radio-sm label::before {
  width: 30px;
  height: 30px;
  top: -13px;
}
.radio.radio-sm label::after {
  width: 22px;
  height: 22px;
  padding-left: 4px;
  font-size: 20px;
  left: 4px;
  top: -9px;
}
.radio.radio-sm label {
  padding-left: 18px;
  top: 13px;
}
.radio.radio-md label::before {
  width: 34px;
  height: 34px;
  top: -17px;
}
.radio.radio-md label::after {
  width: 26px;
  height: 26px;
  padding-left: 4px;
  font-size: 24px;
  left: 4px;
  top: -13px;
}
.radio.radio-md label {
  padding-left: 22px;
  top: 17px;
}
.radio.radio-lg label::before {
  width: 46px;
  height: 46px;
  top: -28px;
}
.radio.radio-lg label::after {
  width: 36px;
  height: 36px;
  padding-left: 4px;
  font-size: 36px;
  left: 5px;
  top: -23px;
}
.radio.radio-lg label {
  padding-left: 34px;
  top: 32px;
}

and here is the plunker: http://plnkr.co/edit/B4BatpwxCa2cBoYo0oEQ?p=preview (show it in fullscreen)
Hope it could help and be in the next release.

from awesome-bootstrap-checkbox.

0xadri avatar 0xadri commented on May 18, 2024

+1 for this issue.

I don't see the point of using Font Awesome in the first place if this plugin can't scale in icon sizes.

@gandaldf is there a pattern in which the code changes when increasing the font size?

If yes, it'd be great to have the SASS mixin doing the magic. It'd make your solution even more generic.

from awesome-bootstrap-checkbox.

0xadri avatar 0xadri commented on May 18, 2024

@gandaldf Did you also have this problem with the ".checkbox-single & .radio-single clickable area" #76 ?

This became really "unacceptable" once the size of the icon got bigger :(

Switching to prettyCheckable. Not CSS only unfortunately, but more mature.

from awesome-bootstrap-checkbox.

gandaldf avatar gandaldf commented on May 18, 2024

Yeah the problem of checkbox/radiobox without label is real, but I haven't time to fix it now... :(
I can't understand what you mean with "a pattern"; I only made a demo with 3 sizes... you can customize the css and have any other dimension.

from awesome-bootstrap-checkbox.

0xadri avatar 0xadri commented on May 18, 2024

I meant some calculation to make it more generic. For instance, allowing to set a given width just changing one variable: ideally you want to build a mixin.

from awesome-bootstrap-checkbox.

hellboy81 avatar hellboy81 commented on May 18, 2024

Can I use this solution at the moment?

from awesome-bootstrap-checkbox.

hellboy81 avatar hellboy81 commented on May 18, 2024

xs classes missing

from awesome-bootstrap-checkbox.

gandaldf avatar gandaldf commented on May 18, 2024

@hellboy81 I don't have the time at the moment to add a new format, if you can, try to develop it by your own and feel free to share your solution.

@adrien-be I don't think it's possibile to have a "pixel perfect" solution using percentual or proportional values... from my tests it always ended with something not perfectly centered.

from awesome-bootstrap-checkbox.

Related Issues (20)

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.