@beeq/tailwindcss 1.0.0

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 ADDED
@@ -0,0 +1,125 @@
1
+ # BEEQ TailwindCSS Preset
2
+
3
+ BEEQ TailwindCSS is a preset that adds BEEQ's opinionated TailwindCSS configuration to your application.
4
+
5
+ ## Prerequisites ๐Ÿงฐ
6
+
7
+ Before starting to use BEEQ TailwindCSS, you need to have installed:
8
+
9
+ - [TailwindCSS](https://tailwindcss.com/docs/installation)
10
+
11
+ Make sure that Tailwind CSS directives are added to your main CSS file:
12
+
13
+ ```css
14
+ @tailwind base;
15
+ @tailwind components;
16
+ @tailwind utilities;
17
+ ```
18
+
19
+ ## Installation ๐Ÿ“ฆ
20
+
21
+ ```bash
22
+ npm i -D @bee-q/tailwindcss
23
+ ```
24
+
25
+ ## Usage ๐Ÿš€
26
+
27
+ ```js
28
+ const beeqPreset = require('@bee-q/tailwindcss');
29
+
30
+ module.exports = {
31
+ content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
32
+ presets: [beeqPreset],
33
+ ...
34
+ }
35
+ ```
36
+
37
+ or with TypeScript:
38
+
39
+ ```ts
40
+ import { default as beeqPreset } from '@bee-q/tailwindcss';
41
+
42
+ export default {
43
+ content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
44
+ presets: [beeqPreset],
45
+ ...
46
+ }
47
+ ```
48
+
49
+ ## CSS reset ๐Ÿงน
50
+
51
+ The preset includes a CSS reset that removes all the default browser styles. If you want to use your own reset, you can add your own CSS reset code to the `@base` layer of TailwindCSS:
52
+
53
+ ```css
54
+ @tailwind base;
55
+ @layer base {
56
+ /* Your CSS reset code */
57
+ }
58
+ @tailwind components;
59
+ @tailwind utilities;
60
+ ```
61
+
62
+ ## Fonts ๐Ÿ–‹
63
+
64
+ The preset does not include the fonts by default, but you can add them in your CSS entry file or use your own custom fonts:
65
+
66
+ ```css
67
+ /* BEEQ Outfit font */
68
+ @import url("https://fonts.googleapis.com/css2?family=Outfit:wght@100;300;400;600;700&display=swap");
69
+ /* ENDAVA Roboto */
70
+ @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700&display=swap');
71
+ ```
72
+
73
+ ## Typography ๐Ÿ“
74
+
75
+ The preset includes a typography plugin that adds a set of default typography styles to your application. It is not enabled by default, so you need to add it to your `tailwind.config.js` file:
76
+
77
+ ```js
78
+ const beeqPreset = require('@bee-q/tailwindcss');
79
+ const { TYPOGRAPHY_DEFAULT } = require('@bee-q/tailwindcss');
80
+
81
+ module.exports = {
82
+ content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
83
+ presets: [require('@bee-q/tailwindcss')],
84
+ ...
85
+ plugins: [
86
+ plugin(function ({ addBase }) {
87
+ // Use the default typography styles
88
+ addBase({ ...TYPOGRAPHY_DEFAULT });
89
+ }),
90
+ ],
91
+ }
92
+ ```
93
+
94
+ or via TypeScript:
95
+
96
+ ```ts
97
+ import plugin from "tailwindcss/plugin";
98
+ import { default as beeqPreset, TYPOGRAPHY_DEFAULT } from "@bee-q/tailwindcss";
99
+ import type { Config } from "tailwindcss";
100
+
101
+ export default {
102
+ content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
103
+ presets: [beeqPreset],
104
+ theme: {},
105
+ plugins: [
106
+ plugin(function ({ addBase }) {
107
+ // Use the default typography styles
108
+ addBase({ ...TYPOGRAPHY_DEFAULT });
109
+ }),
110
+ ],
111
+ corePlugins: {
112
+ preflight: false,
113
+ },
114
+ } satisfies Config;
115
+ ```
116
+
117
+ > Note: you can always override this styles by adding your own CSS code to the `@base` layer of TailwindCSS.
118
+
119
+ ## Complete example
120
+
121
+ [CodeSandbox](https://codesandbox.io/p/sandbox/beeq-tailwind-css-preset-swrtfk?file=%2Ftailwind.config.ts)
122
+
123
+ ## Documentation ๐Ÿ“™
124
+
125
+ Your can find more details about TailwindCSS presets in [the official documentation](https://tailwindcss.com/docs/presets).
package/index.cjs.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./src/index";
2
+ export { default } from "./src/index";
@@ -0,0 +1 @@
1
+ exports._default = require('./index.cjs.js').default;