@ama-pt/agora-design-system 0.11.3 → 0.11.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,20 +46,34 @@ In order to reduce bundle size, we needed do strip some classes from the bundle.
46
46
  > npx tailwindcss init -p
47
47
  ```
48
48
 
49
- - Open tailwind.config.js, set AgoraDS configs, and set the content config with the desired glob to allow tailwind to generate all of the corresponding CSS needed for your project:
49
+ - Add the @tailwind directives for each of Tailwind’s layers to your main CSS file
50
+ ```css
51
+ @tailwind base;
52
+ @tailwind components;
53
+ @tailwind utilities;
54
+ ```
50
55
 
51
- ```js
52
- const { AgoraTailwindConfig } = require('@ama-pt/agora-design-system');
53
56
 
54
- /** @type {import('tailwindcss').Config} */
55
- module.exports = {
56
- content: ['src/**/*.tsx'],
57
+ - Open tailwind.config.ts, set AgoraDS configs, and set the **content** config with the desired glob to allow tailwind to generate all of the corresponding CSS needed for your project:
58
+
59
+ ```typescript
60
+ import { AgoraTailwindConfig } from "@ama-pt/agora-design-system";
61
+ import type { Config } from "tailwindcss";
62
+
63
+ const TailwindConfig: Config = {
64
+ content: ["src/**/*.{ts,tsx}"],
57
65
  theme: AgoraTailwindConfig.theme,
58
- plugins: AgoraTailwindConfig.plugins
66
+ plugins: AgoraTailwindConfig.plugins,
67
+ safelist: AgoraTailwindConfig.safelist,
68
+ corePlugins: {
69
+ preflight: false,
70
+ },
59
71
  };
72
+
73
+ export default TailwindConfig;
60
74
  ```
61
75
 
62
- - import the css style file that exists in node_modules folder
76
+ - import the css style file that exists in node_modules folder into your layout.tsx file (if working with NextJS) or index.tsx (if working with React only)
63
77
 
64
78
  ```typescript
65
79
  // typescript import
@@ -71,12 +85,13 @@ import '@ama-pt/agora-design-system/dist/style.css';
71
85
 
72
86
  ## Overriding Tailwind configuration
73
87
 
74
- To override any tailwind config you need to update the config file as explained in the following example:
88
+ To override any tailwind config you need to update the tailwind.config.ts file as explained in the following example:
75
89
 
76
- ```js
77
- const { AgoraTailwindConfig } = require('@ama-pt/agora-design-system');
90
+ ```typescript
91
+ import { AgoraTailwindConfig } from "@ama-pt/agora-design-system";
92
+ import type { Config } from "tailwindcss";
78
93
 
79
- const TailwindConfig = {
94
+ const TailwindConfig: Config = {
80
95
  content: ['src/**/*.tsx'],
81
96
  theme: {
82
97
  ...AgoraTailwindConfig.theme,
@@ -97,12 +112,10 @@ const TailwindConfig = {
97
112
  }
98
113
  },
99
114
  plugins: AgoraTailwindConfig.plugins,
100
- corePlugins: {
101
- preflight: false
102
- }
115
+ safelist: AgoraTailwindConfig.safelist,
116
+ corePlugins: { preflight: false },
103
117
  };
104
118
 
105
- /** @type {import('tailwindcss').Config} */
106
119
  export default TailwindConfig;
107
120
  ```
108
121