cssaws-amplifyamplifyjs

How to change font size in an Amplify list component?


I'm using Figma-built components in Amplify. The components here are card collections. What I want to do is change the font size for a particular field in one collection of cards. Here is what a close inspection of the page looks like (see below). The highlighted section is the area I want to change.

enter image description here

I tried this construct in my css file (below), but it has no effect.


.styled-text .amplify-flex .amplify-collection .amplify-collection-items .amplify-text {
    font-size: 44px;
}

The way I am using .styled-text is as follows (below).

            <KatsuKappoCardioCardCollection className="styled-text"/>

What am I doing wrong?


Solution

  • Since you're auto-generating the code with Amplify Studio, the best approach is most likely to override Amplify styles as documented here with the overrides prop:

    https://amplify.aws/learn/courses/Fullstack-for-Frontend-Developers-e7319/lessons/9