styled-components: 全局样式

利用 styled-components 创建全局样式

01 安装 styled-components

安装组件

yarn add styled-components

02 添加 createGlobalStyle

创建 globalStyle

import { createGlobalStyle } from 'styled-components';

export default createGlobalStyle`
  table .ck-editor__editable pre {
    margin-bottom: 0;
  }

  .ant-col-0 {
    display: none !important;
  }

  .ant-tag {
    font-size: 12px;
  }
`;

03 引用到项目

以组件方式引入到项目

import GlobalStyles from '@/shared/base/global-styles.tsx';

// 添加到项目
<GlobalStyles />
styled react