Loading...
Find
Log in
Username:
Password:
CapsLock is on.
Remember me (for 1 week)
Log in
Stay in SSL mode
History: Enabling themes to provide values
View page
Source of version: 2
(current)
For the purposes of styling details, the files -+ themes/base_files/less/tiki-selectors.less and /tiki-variables.less +- are the gateway between the component files where the CSS selectors are described, and the themes. For a theme to style Tiki pages and features as completely as possible, it should import tiki-selectors.less and tiki-variables.less and be sure values are provided that are used in those files. Tiki's base_files Less files are something like Bootstrap's component Less files in that they each address a Tiki feature or a page element, etc. In principle these don't contain variables that themes need to have access to. The idea is that they put together the foundation that themes build on, using global properties. CSS rules in these files that themes would benefit by having access to have been collected into the tiki-selectors.less file, and variables are used in this file, rather than hard-coded values, to enable themes to provide appropriate values such as for color. !!! A specific case This also makes it possible for themes to provide values to override the CSS rules of external scripts. Here's an example. There can be conflicts between Tiki's native design details and those of external scripts like jQuery Chosen. We found Chosen dropdown selectors showed bad contrast (white text on a white background). While Tiki already has a -+ tiki-external_scripts_overrides.less +- file to handle situations where the CSS of scripts needs to be modified to work within Tiki, this is compiled to be part of tiki_base.css, not the theme CSS files directly so it isn't so good for specifying colors or fonts, etc. Colors, for example, specified by tiki-external_scripts_overrides.less, which is compiled into tiki_base.css, will be used by all themes. To prevent problems for themes, and allow them to directly provide a CSS rule for the external script override, a rule for the text color property of the Chosen selector dropdown items in tiki-external_scripts_overrides.less was created in tiki-selectors.less {CODE()} .tiki .chosen-container .active-result { color: @chosen-active-result; } {CODE} and a variable was added there for the color property. A default definition for this rule was added in the tiki-variables.less file {CODE()} @chosen-active-result: @input-color; {CODE} which is one of the standard Bootstrap variables, defined in the theme's -+ bootstrap-variables.less +- (equivalent to the default Bootstrap -+ variables.less +- file, defined something like this: {CODE()} //** Text color for `<input>`s @input-color: @gray-dark; // defined above in the file as @gray-dark: #444444; (in the case of the Amelia theme, for example {CODE} In this way any theme can define the text color of the Chosen selector dropdown items. !!! About external style sheets The tiki_base.css file not only provides global CSS rules to be used by all Less-compiled themes, it also supports the use of external Bootstrap.css style sheets that have no awareness of Tiki's CSS requirements. The tiki_base.less file compiles the component Less partials and also imports the default Bootstrap variables.less file to provide default values for such rules as the fix for color contrast in Chosen selectors described above.
Switch Theme
Site theme (fivealive-lite/grape)
Default
Amelia
Business
Cerulean
Cosmo
Cyborg
Darkly
Darkroom
Darkshine
Feb12
Fivealive-lite
Fivealive
Flatly
Greenvalley
Journal
Jqui
Lighty
Litera
Lumen
Lux
Materia
Minty
Morph
Ohia
Pulse
Quartz
Sandstone
Simplex
Sketchy
Slate
Solar
Spacelab
Strasa
Superhero
Thenews
Tikicorp
Tikinewt
Tikipedia
United
Utopias
Vapor
Yeti
None
Akebi
Grape
Kiwi
Lemon
Orange
Plum
Raspberry
Watermelon
Switch
Layout
Stay on this page
Default
Fixed top navbar (uses site icon + "topbar" module zone)
Basic Bootstrap
Classic Tiki (3 containers - header, middle, footer)
Tikipedia
Latest Changes
No records to display
...more
Subscribe to Tiki Newsletters!
Delivered fresh to your email inbox!
Don't miss major announcements and other big news!
Site Config
Site upgraded to Tiki 23.x
Sat 24 of Jul, 2021 00:30 GMT
Site upgraded to Tiki 20
Wed 29 of May, 2019 07:57 GMT
We are now on Tiki 19.x
Fri 05 of Oct, 2018 10:02 GMT
Shoutbox module removed
Thu 28 of Jun, 2018 07:01 GMT
We are now on Tiki 18.x
Wed 02 of May, 2018 08:46 GMT
Upgraded to Tiki 17.0
Wed 02 of Aug, 2017 08:19 GMT
Upgraded to Tiki 15.0alpha
Tue 08 of Mar, 2016 13:34 GMT
Site updated to Tiki 14 beta
Tue 21 of Apr, 2015 00:01 GMT
Testing Tiki10
Thu 15 of Nov, 2012 23:06 GMT
Configurable header buttons in XtratoVeil layout
Wed 17 of Oct, 2012 14:54 GMT