Change font size for text
Asked Answered
W

3

5

Is there an easy way to change font size for some none-header text with Semantic-UI, without make changes to the theme or use plain css?

I see for some elements, like button, one could use large, massive and so one. Perhaps something like this is possible for "normal text" also, but I cannot in the documentation see how, but I might be blind?

Wirephoto answered 15/2, 2016 at 12:47 Comment(0)
P
11

Semantic UI does not have that out of the box. You can write a CSS class that does it for you.

.large.text {
   font-size: 2rem;
}

This would make <p class="large text">Hi there</p> have a size that is twice the size of the baseline text size.

Pozzuoli answered 16/2, 2016 at 13:22 Comment(1)
I needed to add !important to my css for it to work (ie. font-size: 2rem !important;)Cyclops
A
1

You can also add your own CSS to component's .overrides file for the theme you are using and it will be available in your app.

For example, if you are using 'default' theme, you can add the following to button.overrides :

.large.text {
    font-size: 12px;
}

site.variables contains the default font size of the page, it can be changed there as well if it's to be changed everywhere

Abroach answered 19/2, 2016 at 12:34 Comment(0)
C
1

It is possible to be done in Fomantic-UI from version 2.7.2.

Fomantic-UI is a fork of Semantic-UI with ongoing development.

<span class="ui large red text">example of large text</span>

docs: https://fomantic-ui.com/elements/text.html

Cohn answered 9/9, 2021 at 22:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.