Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom theme config #204

Closed
EHLOVader opened this issue Aug 31, 2013 · 3 comments
Closed

Add support for custom theme config #204

EHLOVader opened this issue Aug 31, 2013 · 3 comments
Assignees

Comments

@EHLOVader
Copy link

Currently you have a small set of themes for other frameworks. I had thought of just adding some myself, but I came to the realization this would be better.

I see that getthemes is returning an array of json objects for mapping possible states to classes.

Would it be possible to add your own json into the config instead of a predetermined string key? I don't see a way to do it now.

Maybe something like this to handle that.

self.theme = ( ( self.options["theme"] instanceof Object ) ?
                     self.options["theme"] :
                     self.getThemes()[self.options["theme"]] 
                   )  || self.getThemes()["default"];

This would allow for one off theming or to quickly match frameworks which have yet to be implemented like foundation.

Thanks.

@gfranko
Copy link
Owner

gfranko commented Aug 31, 2013

This is a great idea and should be available through the API. Implementing it should be very easy, but I just need to make sure to add the appropriate documentation. Stay tuned!

Note: I am also in the process of rewriting SelectBoxIt with the jqfactory library, so I will include this in the re-write.

@ghost ghost assigned gfranko Aug 31, 2013
@panych
Copy link

panych commented Sep 30, 2013

It would be great, if you could specify your own css-classes for everything: elements, flags (open, enable) etc. Integrating plugin into existing code will be more easier. Something like:

$('.my-select').selectBoxIt({ 
  containerClass: 'my-select__container',
  btnClass: 'my-select__btn',
  arrowClass: 'my-select__arrow'
  // and so on
});

@gfranko
Copy link
Owner

gfranko commented Oct 4, 2013

@EHLOVader @panych I just released v3.8.0, which allows passing in a custom theme configuration object. Like this:

Note: These are the defaults.

$('select').selectBoxIt({
  'theme': {
    'focus': 'selectboxit-focus',
    'hover': 'selectboxit-hover',
    'enabled': 'selectboxit-enabled',
    'disabled': 'selectboxit-disabled',
    'arrow': 'selectboxit-default-arrow',
    'button': 'selectboxit-btn',
    'list': 'selectboxit-list',
    'container': 'selectboxit-container',
    'open': 'selectboxit-open'
  }
});

@gfranko gfranko closed this as completed Oct 4, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants