Comments (2)
I think the first step should be to provide a way for developer to tell that no styling should be applied to the input element. This way, input gets all styling for application global stylesheet and looks like all other inputs and the developer is free to style and position the swatch anyway he wants relative to the input (beside/inside etc.).
I've found a way to do it pretty easily by extracting all the current hardcoded styling of the input element into ".minicolors-default-theme" class, and setting $.minicolors.defaultSettings.classes to be that default. This way, when I specify another class or do not specify a class at all, no styling is applied to the input, and my inputs stay formatted the same as all other inputs in my page. All is left to do is to add a little styling to the swatch and that's it.
For example, in my application I'm using bootstrap, and all my inputs are styled with big padding and rounded corners. I change $.minicolors.defaultSettings.classes="minicolors-boostrap-theme", add my own styling in 'minicolors-bootstrap-theme' class to position swatch inside the input element and everything looks great.
I've created a pull request for this, hope you accept it.
from jquery-minicolors.
I've made a few more updates. classes
and styles
were removed from the settings in lieu of theme
. The default theme is default
and I've polished off and merged the custom theme (now called bootstrap
) into the stylesheet. I also made it adhere to the swatchPosition
and position
settings.
In the future, maybe we'll see some theme contributions that we can add to the stylesheet. It would probably be most sensible to mimic themes for popular libraries (much like @alextk has done with the bootstrap
theme).
Overall, this update makes it much easier to style the control. Special thanks to @alextk for his help with this. At this point, I feel like this issue is pretty much resolved, so I'm going to close it.
from jquery-minicolors.
Related Issues (20)
- Position failed HOT 1
- The position of the picker does not work correctly when the scale value of the body tag is changed. HOT 1
- Request: beforeShow event
- How to import minicolors with webpack? HOT 3
- Performance bugs HOT 3
- displaying HEX code in the color picker panel itself HOT 2
- getting a checked image when selecting a preset swatch HOT 4
- Problem with opacity + wheel HOT 1
- Option to show text input with `inline` option? HOT 1
- Scrolling on mobile HOT 5
- jQuery 4 deprecation warnings
- Any chance of updating this to HDR colours? HOT 1
- Updating settings with shorter array of swatches causes exception
- Initial selection is black HOT 1
- Update github website URL HOT 1
- Use 'Transparent' on swatches HOT 3
- Worst documentation I've even seen ! HOT 1
- bootstrap 5 theme & input-group
- Dynamically add mincolors to a field HOT 1
- Duplicated values in the swatch result in multiple same colors in the swatch HOT 1
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 jquery-minicolors.