如何更改Amplify列表组件中的字体大小?

huangapple go评论64阅读模式
英文:

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.

如何更改Amplify列表组件中的字体大小?

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?

英文:

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.

如何更改Amplify列表组件中的字体大小?

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?

答案1

得分: 1

因为您正在使用Amplify Studio自动生成代码,最好的方法很可能是按照此处文档中的overrides属性进行覆盖Amplify样式:

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

英文:

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

huangapple
  • 本文由 发表于 2023年5月26日 01:06:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76334727.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定