码迷,mamicode.com
首页 > 其他好文 > 详细

[React] Extend styles with styled-components in React

时间:2018-10-21 10:19:03      阅读:111      评论:0      收藏:0      [点我收藏+]

标签:port   text   hit   upper   end   tom   16px   Fix   exp   

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] Extend styles with styled-components in React

标签:port   text   hit   upper   end   tom   16px   Fix   exp   

原文地址:https://www.cnblogs.com/Answer1215/p/9823944.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!