
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fixโa new CLI tool that turns CVE alerts into safe, automated upgrades.
checkboxes
Advanced tools
A library for customizable checkboxes โ
๐ Website Demo
Different browsers have different implementations for checkboxes:
See this post about not able to style checkboxes. ๐ญ
Chrome uses the thick white tick, while Safari, Opera, Edge and Firefox all use the thin white tick. ๐ข
In addition, Safari, Opera and Edge use user's preferred Accent colour (from System Preferences on a Mac) as background for the checkboxes, whereas Chrome and Firefox stick with blue background. ๐คฏ
These checkboxes by browsers are styled by User Agent style sheets and they can not be overridden easily. ๐
Thus, these checkboxes can hardly match the logo and theme colour of a website or a system! ๐ฉ
After some work, I successfully styled the checkboxes for our company's website. ๐
See my reflection tweet.
I would like to style them with ease in the future and for everyone, hence the creation of this small side project. ๐
There are now a couple of customizable options for the checkboxes. And many more to come!
Add this line to HTML file
<link rel="stylesheet" type="text/css" href="https://unpkg.com/checkboxes@1.3.3/dist/css/checkboxes.min.css">
โ
Install checkboxes package using npm
npm i checkboxes
then
add this line to index.js
require('checkboxes');
OR
add this line to HTML file
<link rel="stylesheet" type="text/css" href="checkboxes/dist/css/checkboxes.min.css">
โ
Add "checkbox" class to the checkbox input.
(Optionally, add custom styles to the element to change it from the default styles.)
i.e.
from
<input type="checkbox">
to
<input type="checkbox" class="checkbox"
style="--size: {NUMBER}px; --radius: {NUMBER}px; --bg: #{RRGGBB}; --color: #{RRGGBB}; --time: {NUMBER}s;" {checked}>
e.g.
<input type="checkbox" class="checkbox"
style="--size: 20px; --radius: 8px; --bg: #000000; --color: #F47A37; --time: 0.4s;">
where the default style is
input[type='checkbox'].checkbox {
--size: 12px;
--radius: calc(var(--size) / 10);
--bg: red;
--color: white;
--time: 0.5s;
}
which can be easily overridden.
.
|-- LICENSE
|-- README.md
|-- dist
| `-- css
| `-- checkboxes.min.css
|-- gulpfile.js
|-- package-lock.json
|-- package.json
`-- src
|-- checkboxes.html
`-- scss
`-- checkboxes.scss
See also the list of contributors who participated in this project.
This project is licensed under the MIT License
FAQs
Customizable checkboxes
The npm package checkboxes receives a total of 42 weekly downloads. As such, checkboxes popularity was classified as not popular.
We found that checkboxes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.ย It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fixโa new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
Weโre excited to announce a powerful new capability in Socket: historical data and enhanced analytics.