CSS-плагин GatsbyJS для типографики перезаписывается - PullRequest
0 голосов
/ 25 сентября 2019

У меня есть приложение GatsbyJS с TypographyJS (через плагин Gatsby) с платформой Ant Design UI.Плагин типографии добавлен в соответствии с официальной документацией, здесь

Чтобы заставить CSS design ant работать, вы должны импортировать CSS CSS ant design в файл gatsby-browser.js в соответствии с их документацией, здесь

CSS-дизайн Ant перезаписывает стили плагинов для типографики. Я хочу использовать стиль дизайна муравья с типографикой для шрифтов и т. Д.

gatsby-browser.js

/**
 * Implement Gatsby's Browser APIs in this file.
 *
 * See: https://www.gatsbyjs.org/docs/browser-apis/
 */

// You can delete this file if you're not using it
import 'antd/dist/antd.css'

typography.js

import Typography from "typography"
import fairyGateTheme from "typography-theme-fairy-gates"

/**
 * Issue:
 * Fairy Gates Theme: Messed up text shadow in default starter project header
 * 
 * Solution:
 * https://github.com/KyleAMathews/typography.js/issues/155#issuecomment-490715480
 */
fairyGateTheme.overrideThemeStyles = () => ({
  a: {
    textShadow: `none`,
    backgroundImage: `none`,
  },
});

const typography = new Typography(fairyGateTheme)

export const { scale, rhythm, options } = typography
export default typography
...