Magno Alberto
Magno Alberto

Reputation: 668

bootstrap how to inherit font-size-small variable?

I have a PHP application that uses Twitter Bootstrap and allows the user to select the preferred Bootswatch theme. In the application, there is a PHP class to build a datagrid (table thead tbody tfoot), however within the <td> element was inserted into the <small>, then removed the <small> and decide to use CSS.

td { font-size:0.85em; vertical-align: middle !important; }

However, several Bootswatch themes using a less variable @font-size-small, and I would like my datagrid reuse this variable, in other words, when the user to choose a Bootswatch theme, the datagrid font size would be adjusted based on the theme and not explicitly defined by font-size:0.85em;

Thanks!

Upvotes: 0

Views: 1180

Answers (1)

Rafael RN
Rafael RN

Reputation: 176

You have some ways to do this, one of them is specify a class in the body or in the container to change the style which theme is selected.

Like this:

body.theme1 {
  font-size: 0.85em;
}

body.theme2 {
  font-size: 1.25em;
}

or in LESS/SASS:

body.theme1 {
  font-size: @font-size-small;
}

body.theme2 {
  font-size: @font-size-small-theme2;
}

Upvotes: 1

Related Questions