In this lesson, you will learn how to extend styles from one styled-component to another in a React app. This is helpful when you have two styled-components that are similar but differ in one or more CSs properties.
import styled from 'styled-components'; export const Button = styled.button` background-color: #FF851B; border-radius: 5px; color: white; display: block; font-weight: bold; font-size: 22px; padding: 16px 32px; text-transform: uppercase; margin: 100px auto; `; export const HelpButton = styled(Button)` background-color: #FF4136; margin: 15px; position: fixed; bottom: 0; right: 0; `;
本文将指导你如何在React应用程序中从一个样式化的组件扩展样式到另一个组件。当你有两个相似但某些CSS属性不同的样式化组件时,这种方法非常有用。
664

被折叠的 条评论
为什么被折叠?



