Comments (11)
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.
+1 - I'd need it too!
from awesome-bootstrap-checkbox.
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.
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.
+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.
@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.
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.
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.
Can I use this solution at the moment?
from awesome-bootstrap-checkbox.
xs
classes missing
from awesome-bootstrap-checkbox.
@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)
- printing - selected radio button not visible HOT 1
- Undefined variable: "$input-border-color" in awesome-bootstrap-checkbox.scss HOT 2
- border is not pretty when focus expecially the radio box HOT 3
- Incompatibility list with bootstrap v4.0.0-beta HOT 1
- Undefined variable: "$form-check-input-gutter" HOT 3
- Not working with Asp webforms HOT 2
- Integration with bootstrap-vue HOT 1
- Checkbox click not working on 1.0.0 HOT 2
- Usage with FontAwesome v5 HOT 14
- Checkbox is not working without these specific attributes HOT 1
- Long label - prevent text from wrapping?
- Support for react-bootstrap
- :after content doesn't display on ios
- Border thickness as variable
- checkbox and radio buttons HOT 1
- Checkbox Inside table column HOT 2
- label padding-left creates a clickable area to the right of the checkbox when used in table
- Error npm install awesome-bootstrap-checkbox
- Latest version missing from npm?
- Is it normal to have indeterminate state on input radio when nothing are selected ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from awesome-bootstrap-checkbox.