github chakra-ui/panda @pandacss/types@0.43.0

latest releases: @pandacss/token-dictionary@0.51.1, @pandacss/types@0.51.1, @pandacss/studio@0.51.1...
5 months ago

Minor Changes

  • e952f82: Add support for defining global font face in config and preset

    // pandacss.config.js
    export default defineConfig({
      globalFontface: {
        Roboto: {
          src: 'url(/fonts/roboto.woff2) format("woff2")',
          fontWeight: '400',
          fontStyle: 'normal',
        },
      },
    })

    You can also add multiple font src for the same weight

    // pandacss.config.js
    
    export default defineConfig({
      globalFontface: {
        Roboto: {
          // multiple src
          src: ['url(/fonts/roboto.woff2) format("woff2")', 'url(/fonts/roboto.woff) format("woff")'],
          fontWeight: '400',
          fontStyle: 'normal',
        },
      },
    })

    You can also define multiple font weights

    // pandacss.config.js
    
    export default defineConfig({
      globalFontface: {
        // multiple font weights
        Roboto: [
          {
            src: 'url(/fonts/roboto.woff2) format("woff2")',
            fontWeight: '400',
            fontStyle: 'normal',
          },
          {
            src: 'url(/fonts/roboto-bold.woff2) format("woff2")',
            fontWeight: '700',
            fontStyle: 'normal',
          },
        ],
      },
    })

Don't miss a new panda release

NewReleases is sending notifications on new releases.