📜  如何在样式化的组件中使用另一个元素的相同设置 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:36.006000             🧑  作者: Mango

代码示例1
import styled, { css } from ‘styled-components’;

const baseInputStyles = css`
  padding: 0.5em;
`;

const StyledA = styled.a`
  ${baseInputStyles}
`;

const StyledButton = styled.button`
  ${baseInputStyles}
  /* make changes as needed*/
`;