Git Product home page Git Product logo

Comments (2)

alextk avatar alextk commented on July 23, 2024

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.

claviska avatar claviska commented on July 23, 2024

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)

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.