
I’m still in the process of scratch-building a responsive WordPress theme with Bootstrap and today decided to tackle the search widget styling. Well, to be completely honest I’m not quite scratch-building it — I’m adapting Automattic’s Toolbox theme, but I’m hand-rolling most of the responsive features.
If you’re not using Bootstrap, the process of styling the search widget is pretty straightforward — just modify (or define) the relevant CSS classes and you’re good to go. In order to use Bootstrap icons, however, it helps to restructure the the form input element. Since Bootstraps’ icons (from Glyphicons) are all stored in single sprite you can’t link directly to an individual icon in order to set it as a CSS element’s background property. Instead you specify the icon by CSS class name, which positions the element’s viewport over the selected part of the sprite.
Continue reading