Helium theme - cuba.theme.defaultSize not working?

Hi,

I tried it in different ways,
but for me the
cuba.theme.defaultSize = small
does not work.
This setting
cuba.theme.sizes = small|medium
is working fine.
I can only select those two, so I think the helium-theme.properties file is used in a correct way.
Also I can see, that the new user get an entry in the user_setting table for heliumSize,
but the value is empty.
Any idea what to do?
KR
Roland

and after doing some more testing it looks like, that the cuba.theme.defaultSize setting causes, that doing the setting manually in the help - theme_setting menu does not work any more… I can change there from small to medium but I cannot get small running again.
When I take out the cuba.theme.defaultSize , I can again use the manual settings.

Hi @r.walde,

Theme properties in the helium-theme.properties work in conjunction with styles. For instance, cuba.theme.defaultSize is used to define what size preset has no additional class name and can’t be changed without corresponding changes in styles. The same applicable for cuba.theme.defaultMode.

Currently, there is no way to define default size to use if no user settings are presented. We have an issue on GitHub to implement such functionality.

Regards,
Gleb

1 Like

thx

Regards
Roland

Hi Gleb,

I saw the issue, thx.
Do you have any roadmap information when you would plan to implement that?
I am asking, because I need an answer for the user of the next app rollout.
If it there is no date now, I need to think about a workaround on our side.

Regards
Roland

Hi @r.walde,

We have no plans yet regarding this issue. Probably, next week we’ll be able to take a look.

Regards,
Gleb

Hi @r.walde,

the mentioned feature has been implemented and will be included in the very next Helium release for the CUBA 7.2.

Please note that it has breaking changes. You can read more in my comment on GitHub: Add the ability to change theme default values · Issue #27 · cuba-platform/helium-theme · GitHub

Regards,
Gleb

1 Like

Hi @gorelov

I moved to 7.2.7 and try to set Helium default size to small with the following web-app.properties.

It does not work. Tried to clear user settings, nothing. The theme by itself is working, but still appears at medium size by default.

cuba.themeConfig=com/haulmont/cuba/havana-theme.properties com/haulmont/cuba/halo-theme.properties com/haulmont/cuba/hover-theme.properties /com/company/svp/web/helium-theme.properties
cuba.web.theme = helium
cuba.theme.helium.modes = light|dark
cuba.theme.helium.defaultModeToUse = light
cuba.theme.helium.sizes = small|medium|large
cuba.theme.helium.defaultSize = small
cuba.theme.helium.defaultSizeToUse = small

The notes on GitHub says the following:

cuba.theme.helium.defaultSize - the name of size preset that has no additional style class name. Default: medium . Note: can’t be changed without corresponding changes in styles.

What does mean “can’t be changed without corresponding change in styles” ?

Regards
Michael

Let’s take TextField styles as an example. In the textfield.scss file you can find the following styles:

 &.small .#{$primary-stylename} {
  @include he-input-size-style($unit-size: $v-unit-size--small, $font-size: $v-font-size--small);
}

&.large .#{$primary-stylename} {
  @include he-input-size-style($unit-size: $v-unit-size--large, $font-size: $v-font-size--large);
}

As you can see, there are no styles for the medium size, i.e. it has no additional style class name, as a result it is defined as the default value for the cuba.theme.helium.defaultSize property. In simple words, cuba.theme.helium.defaultSize and cuba.theme.helium.defaultMode are internal properties and should not be changed.

This is because you defined cuba.theme.helium.defaultSize = small. Remove this attribute, clear user settings and page cookies.

Regards,
Gleb

So it means that it is not possible to have default size to small, and each user needs to select small in his/her settings ?

You need to use the special attribute:

cuba.theme.helium.defaultSizeToUse - the name of size preset to be used if no other settings are available. Either cookie or user settings obtained from UserSettingService have precedence over this value.

1 Like

Ok got it thanks @gorelov
Michael