Loading...
Skip to main content
Home Page
About
Marketplace
Sample page
Wishlist at dev site
Sitemap (Categories)
Tiki Customization
Creating a theme
Converting a Bootstrap theme
Contributing, sharing or selling
Customizing icons
Tips
Template Tricks
CSS Tricks
Feature Examples
Articles
Blogs
Calendar
Forums
FAQs
Trackers
Files
Links Directory
Wiki Pages
Find
History: Enabling themes to provide values
View published 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.
Layout
Stay on this page
Default
Single Container
Classic Bootstrap
Classic Tiki (3 containers - header, middle, footer)
Tikipedia
Latest Changes
Included themes
Bootstrap component sets
Materia
Ohia
Themes
Making or Updating a Theme for Tiki 27
Updating a Theme for Tiki 26
Tiki_org_family_customizations_CSS
BookStacked
Make an SCSS-Compiled Tiki Theme
...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 branch 27x
Wed 24 of Apr, 2024 11:12 GMT-0000
Site upgraded to branch 26x
Wed 21 of Jun, 2023 09:45 GMT-0000
Site upgraded to branch 25x
Sat 12 of Nov, 2022 17:00 GMT-0000
Site upgraded to Tiki 23.x
Sat 24 of Jul, 2021 00:30 GMT-0000
Site upgraded to Tiki 20
Wed 29 of May, 2019 07:57 GMT-0000
We are now on Tiki 19.x
Fri 05 of Oct, 2018 10:02 GMT-0000
Shoutbox module removed
Thu 28 of Jun, 2018 07:01 GMT-0000
We are now on Tiki 18.x
Wed 02 of May, 2018 08:46 GMT-0000
Upgraded to Tiki 17.0
Wed 02 of Aug, 2017 08:19 GMT-0000