1

I'm learning PrimeVue 4 and I can't figure out how to customize its components' design tokens.

For example, this page https://primevue.org/iftalabel (under the "themes" tab) has a list of design tokens

But I have no idea how to customize, for example, the iftalabel.font.size token

I tried to specify in my main.scss module value for --p-iftalabel-font-size variable but with no success:

:root {
    --p-iftalabel-font-size: 0.8rem;
}

Could someone please tell me how to do this properly?

1

1 Answer 1

1

You can do this in 2 ways (as far as i know): 1 -> add !important to your css line, like this

:root {
--p-iftalabel-font-size: 5px !important;
}

2 -> you can do it the "better" way by modifying the main.js, with definePreset, something like this

const MyPreset = definePreset(Aura, {
    components: {
        iftalabel: {
            root:{
               fontSize: '0.8rem'
            }
        }
    }
});

You can check this guy tutorial, he shows all the process. YouTube Guy PrimeVue Theming

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.