加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

[React] Extend styles with styled-components in React

发布时间:2020-12-15 20:21:48 所属栏目:百科 来源:网络整理
导读: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 ‘s

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;
`;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读