3.7.1 • Published 22 days ago

antd-style v3.7.1

Weekly downloads
-
License
MIT
Repository
github
Last release
22 days ago

antd-style

NPM version NPM downloads install size

Test CI status Rlease CI Coverage

 docs by dumi Build With father

Introduction

A business-level css-in-js solution built on the Ant Design V5 Token System. It is based on emotion at the bottom.

  • 🧩 Token System: Default integration of Ant Design V5 Token System, making style customization easy, and token consumption flexible and easy to use;
  • 🌓 One-click Dark Mode Switching: Based on antd v5 cssinjs dynamic theme configuration and dark theme algorithm encapsulation, it provides an easy-to-use light and dark theme switching capability for application-level scenarios, making it easier to use;
  • 🎨 Flexible Custom Theme Extension: Ant Design Style provides the functionality of custom tokens and custom styles. When the default tokens of antd cannot meet the style requirements, you can flexibly extend your own theme system and freely consume it in CSS in JS;
  • 🏂 Smooth Migration from less: Need to migrate an old project? Using antd-style can smoothly migrate less in the project to CSS in JS at a lower cost, and provide a better user experience and development experience;
  • ☯️ Good Compatibility with Micro-Apps: Ant Design Style is compatible with qiankun micro-apps by default (but may sacrifice some performance). At the same time, it provides performance optimization options for scenarios that do not require micro-apps;
  • 📱 Easy Adaptation for Responsive Design: Ant Design Style will provide convenient utility functions for responsive applications, helping developers quickly complete responsive theme development;
  • 🪴 Stylish: Ant Design Style provides the ability to compose complex interactive styles through the combination of multiple atomic tokens, achieving a high degree of reusability;
  • 🌰 Documentation and Application Examples: Show various examples of components and applications using Ant Design Style, helping developers get started quickly. (This document is also built using Ant Design Style for styling)

Quick Start

Installation

It is recommended to install using pnpm

pnpm i antd-style -S

Typical Use Cases

Create Styles

import { createStyles } from 'antd-style';

const useStyles = createStyles(({ token, css }) => ({
  // Supports the writing style of css object
  container: {
    backgroundColor: token.colorBgLayout,
    borderRadius: token.borderRadiusLG,
    maxWidth: 400,
    width: '100%',
    height: 180,
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
    flexDirection: 'column',
    marginLeft: 'auto',
    marginRight: 'auto',
  },
  // Also supports obtaining the same writing experience as normal css through css string templates
  card: css`
    box-shadow: ${token.boxShadow};
    padding: ${token.padding}px;
    border-radius: ${token.borderRadius}px;
    color: ${token.colorTextTertiary};
    background: ${token.colorBgContainer};
    transition: all 100ms ${token.motionEaseInBack};

    margin-bottom: 8px;
    cursor: pointer;

    &:hover {
      color: ${token.colorTextSecondary};
      box-shadow: ${token.boxShadowSecondary};
    }
  `,
}));

export default () => {
  // The styles object in the useStyles method is cached by default, so there is no need to worry about re-rendering issues
  const { styles, cx, theme } = useStyles();

  return (
    // Use cx to organize className
    <div className={cx('a-simple-create-style-demo-classname', styles.container)}>
      <div className={styles.card}>createStyles Demo</div>
      {/* The theme object contains all token and theme information */}
      <div>Current theme mode: {theme.appearance}</div>
    </div>
  );
};

CHANGELOG

Details: CHANGELOG

License

MIT

@infinitebrahmanuniverse/nolb-antd@everything-registry/sub-chunk-1144aelfd-designtest-wsdk@ym56/ym-designlobe-uimuch-libraryhf-antd-prohumxkitchen-color-studiokitchen-flow-editorjiaoneiuinb-ui-proods-component-libpnpm-monorepo-muipetercat-luirc-lzbuisinking-componentstl-frontend-component-v5tl-frontend-componentsumi-demo-henryptumi-plugin-antd-styletopology-designabletui-componentstui_web_core@aidc/saas-ui@aipmorg/chat@appthen/antd@ant-design/pro-flow@ant-design/pro-flow-editor@arietta-studio/readme-wizard@aelf-design/icons@aelf-design/internal-icons@baic/yolk-umi@baic/yolk-antd-style@chat2db/ui47core-demo@bentwnghk/chat@dext7r/hooks@datoou/components@daphnis/d-proyaoyctestym-design@guanjdoj/test@hanzo/chat@ihccc/layouts@ihccc/components@icraft/common@fcodes/dumi-theme@gbeata/mapping@et-modules/mui@govey1nw/lobehub-chat@lobehub/chat@lobehub/chat-plugin-realtime-weather@lobehub/chat-plugin-search-engine@lobehub/readme-generator@mxssfd/dumi-theme-antd-style@nicecode/meta@nocobase/client@dzo/com@mongchhi/ui-block@petercatai/assistant@restcloud-npm/rc-lowcode-componentdumi-theme-antd-styledumi-theme-antd-style-nbbdumi-theme-antd-web3dumi-theme-antd-web3-testdumi-theme-ariettadumi-theme-ayahubdumi-theme-dyeingdumi-theme-multiway-docsdumi-theme-xieyezidumi-theme-aipmhubevil-pro-cliet-muietest-ui@ten24group/ui24fincamex-pruebafan-standard-compesarj-ui-lib@wowon/components@wowon/layouts@zykj2024/much-libraryaim-components@zalastax/nolb-antdant-lunar-pickerantd-color-editoraui-designbsin-agent-uicalendar-carouselcanyon-uicsci_lowcode_materialsd2coreuidoupio
3.7.2-alpha.1

22 days ago

3.7.1-beta.1

2 months ago

3.7.1

2 months ago

3.7.0-beta.1

3 months ago

3.7.0

3 months ago

3.6.3

3 months ago

3.6.2

9 months ago

3.6.2-beta.1

9 months ago

3.6.1

1 year ago

3.6.0

1 year ago

3.4.2-beta.1

1 year ago

3.5.2

1 year ago

3.5.1

1 year ago

3.5.0

1 year ago

3.5.0-beta.1

1 year ago

3.4.4

1 year ago

3.4.3

1 year ago

3.4.2

1 year ago

3.4.7

1 year ago

3.4.6

1 year ago

3.4.5

1 year ago

3.4.1-beta.1

1 year ago

3.4.0-alpha.1

1 year ago

3.4.0

1 year ago

3.4.1

1 year ago

3.3.0

2 years ago

3.3.0-beta.2

2 years ago

3.3.0-beta.1

2 years ago

3.2.2

2 years ago

3.2.1

2 years ago

3.2.0

2 years ago

3.2.3

2 years ago

3.1.1

2 years ago

3.2.0-beta.2

2 years ago

3.2.0-beta.1

2 years ago

3.2.1-beta.1

2 years ago

3.1.0

2 years ago

3.0.1-beta.1

2 years ago

3.1.0-beta.1

2 years ago

3.1.0-beta.2

2 years ago

3.1.0-beta.3

2 years ago

3.0.0-beta.21

2 years ago

3.0.0-beta.22

2 years ago

3.0.0

2 years ago

3.0.0-alpha.58

2 years ago

3.0.0-alpha.57

2 years ago

3.0.0-alpha.59

2 years ago

3.0.0-alpha.50

2 years ago

3.0.0-alpha.52

2 years ago

3.0.0-alpha.51

2 years ago

3.0.0-alpha.54

2 years ago

3.0.0-alpha.53

2 years ago

3.0.0-alpha.56

2 years ago

3.0.0-alpha.55

2 years ago

3.0.0-alpha.60

2 years ago

3.0.0-beta.1

2 years ago

3.0.0-beta.3

2 years ago

3.0.0-beta.2

2 years ago

3.0.0-beta.5

2 years ago

3.0.0-beta.4

2 years ago

3.0.0-beta.7

2 years ago

3.0.0-beta.6

2 years ago

3.0.0-beta.9

2 years ago

3.0.0-beta.8

2 years ago

3.0.0-beta.20

2 years ago

3.0.0-beta.19

2 years ago

3.0.0-beta.10

2 years ago

3.0.0-beta.11

2 years ago

3.0.0-beta.12

2 years ago

3.0.0-beta.13

2 years ago

3.0.0-beta.14

2 years ago

3.0.0-beta.15

2 years ago

3.0.0-beta.16

2 years ago

3.0.0-beta.17

2 years ago

3.0.0-beta.18

2 years ago

3.0.0-alpha.47

2 years ago

3.0.0-alpha.46

2 years ago

3.0.0-alpha.49

2 years ago

3.0.0-alpha.48

2 years ago

3.0.0-alpha.41

2 years ago

3.0.0-alpha.43

2 years ago

3.0.0-alpha.42

2 years ago

3.0.0-alpha.45

2 years ago

3.0.0-alpha.44

2 years ago

3.0.0-alpha.40

2 years ago

3.0.0-alpha.39

2 years ago

3.0.0-alpha.38

2 years ago

3.0.0-alpha.37

2 years ago

3.0.0-alpha.36

2 years ago

3.0.0-alpha.35

2 years ago

3.0.0-alpha.34

2 years ago

3.0.0-alpha.33

2 years ago

3.0.0-alpha.32

2 years ago

3.0.0-alpha.31

2 years ago

3.0.0-alpha.30

2 years ago

3.0.0-alpha.29

2 years ago

3.0.0-alpha.28

2 years ago

3.0.0-alpha.27

2 years ago

3.0.0-alpha.26

2 years ago

3.0.0-alpha.25

2 years ago

3.0.0-alpha.24

2 years ago

3.0.0-alpha.23

2 years ago

3.0.0-alpha.22

2 years ago

3.0.0-alpha.21

2 years ago

3.0.0-alpha.20

2 years ago

3.0.0-alpha.19

2 years ago

3.0.0-alpha.18

2 years ago

3.0.0-alpha.17

2 years ago

3.0.0-alpha.16

2 years ago

3.0.0-alpha.15

2 years ago

3.0.0-alpha.14

2 years ago

3.0.0-alpha.13

2 years ago

3.0.0-alpha.12

2 years ago

3.0.0-alpha.11

2 years ago

3.0.0-alpha.10

2 years ago

3.0.0-alpha.9

2 years ago

3.0.0-alpha.8

2 years ago

3.0.0-alpha.7

2 years ago

3.0.0-alpha.6

2 years ago

3.0.0-alpha.5

2 years ago

3.0.0-alpha.4

2 years ago

3.0.0-alpha.3

2 years ago

3.0.0-alpha.2

2 years ago

3.0.0-alpha.1

2 years ago

2.0.2

2 years ago

2.0.2-alpha.1

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.0-rc.15

2 years ago

1.0.0-rc.14

2 years ago

1.0.0-rc.13

2 years ago

1.0.0-rc.12

2 years ago

1.0.0-rc.11

2 years ago

1.0.0-rc.10

2 years ago

1.0.0-rc.9

2 years ago

1.0.0-rc.8

2 years ago

1.0.0-rc.7

2 years ago

1.0.0-rc.6

2 years ago

1.0.0-rc.5

2 years ago

1.0.0-rc.4

2 years ago

1.0.0-rc.3

2 years ago

1.0.0-rc.2

2 years ago

1.0.0-rc.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.0.0

2 years ago