@vinicunca/unocss-preset 0.0.2

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/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "@vinicunca/unocss-preset",
3
+ "version": "0.0.2",
4
+ "packageManager": "pnpm@7.15.2",
5
+ "description": "UnoCSS custom preset",
6
+ "author": "praburangki<https://github.com/praburangki>",
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/vinicunca/unocss-preset#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/vinicunca/unocss-preset.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/vinicunca/unocss-preset/issues"
15
+ },
16
+ "keywords": [
17
+ "unocss",
18
+ "unocss-preset"
19
+ ],
20
+ "sideEffects": false,
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "require": "./dist/index.cjs",
25
+ "import": "./dist/index.mjs"
26
+ },
27
+ "./client": {
28
+ "types": "./dist/client.d.ts",
29
+ "require": "./dist/client.cjs",
30
+ "import": "./dist/client.mjs"
31
+ },
32
+ "./*": "./styles/*"
33
+ },
34
+ "main": "./dist/index.cjs",
35
+ "module": "./dist/index.mjs",
36
+ "types": "./dist/index.d.ts",
37
+ "typesVersions": {
38
+ "*": {
39
+ "client": [
40
+ "./dist/client.d.ts"
41
+ ]
42
+ }
43
+ },
44
+ "files": [
45
+ "dist",
46
+ "styles"
47
+ ],
48
+ "peerDependencies": {
49
+ "unocss": "*",
50
+ "@vinicunca/js-utilities": "*"
51
+ },
52
+ "devDependencies": {
53
+ "@commitlint/cli": "^17.4.2",
54
+ "@commitlint/config-conventional": "^17.4.2",
55
+ "@vinicunca/eslint-config": "^1.6.2",
56
+ "@vinicunca/js-utilities": "^2.6.4",
57
+ "bumpp": "^8.2.1",
58
+ "commitizen": "^4.2.6",
59
+ "conventional-changelog-cli": "^2.2.2",
60
+ "cz-customizable": "^7.0.0",
61
+ "eslint": "^8.32.0",
62
+ "eslint-define-config": "^1.14.0",
63
+ "husky": "^8.0.3",
64
+ "is-ci": "^3.0.1",
65
+ "lint-staged": "^13.1.0",
66
+ "typescript": "^4.9.4",
67
+ "unbuild": "^1.1.1",
68
+ "unocss": "^0.49.0",
69
+ "vitest": "^0.28.2"
70
+ },
71
+ "publishConfig": {
72
+ "access": "public"
73
+ },
74
+ "scripts": {
75
+ "release": "bumpp package.json --commit --push --tag --commit 'chore: release v'",
76
+ "build": "unbuild",
77
+ "dev": "unbuild --stub",
78
+ "lint": "eslint --fix .",
79
+ "precommit": "lint-staged -c ./.husky/.lintstagedrc -q",
80
+ "test": "vitest -u"
81
+ }
82
+ }
@@ -0,0 +1,318 @@
1
+ * {
2
+ /* Remove default margin on everything */
3
+ margin: 0;
4
+
5
+ /* Remove default padding on everything */
6
+ padding: 0;
7
+
8
+ /* Calc `em` based line height, bigger line height for smaller font size and smaller line height for bigger font size: https://kittygiraudel.com/2020/05/18/using-calc-to-figure-out-optimal-line-height/ */
9
+ line-height: calc(0.25rem + 1em + 0.25rem);
10
+ }
11
+
12
+ *,
13
+ ::before,
14
+ ::after {
15
+ /* Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) */
16
+ box-sizing: border-box;
17
+
18
+ /* Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) */
19
+ border-width: 0;
20
+ border-style: solid;
21
+ border-color: currentColor;
22
+
23
+ /* Remove border and set sensible defaults for backgrounds, on all elements except fieldset progress and meter */
24
+ background-origin: border-box;
25
+ background-repeat: no-repeat;
26
+ }
27
+
28
+ html {
29
+ /* Making sure text size is only controlled by font-size */
30
+ -webkit-text-size-adjust: none;
31
+
32
+ /* Use a more readable tab size. */
33
+ -moz-tab-size: 4;
34
+ tab-size: 4;
35
+
36
+ /* Use the user's configured `sans` font-family by default. */
37
+ font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
38
+ 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,
39
+ 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
40
+ }
41
+
42
+ /* Smooth scrolling for users that don't prefer reduced motion */
43
+ @media (prefers-reduced-motion: no-preference) {
44
+ html:focus-within {
45
+ scroll-behavior: smooth;
46
+ }
47
+ }
48
+
49
+ body {
50
+ /* Improve text rendering */
51
+ -webkit-font-smoothing: antialiased;
52
+
53
+ /* https://marco.org/2012/11/15/text-rendering-optimize-legibility */
54
+ text-rendering: optimizeSpeed;
55
+
56
+ /* Allow percentage-based heights in the application */
57
+ min-block-size: 100%;
58
+ }
59
+
60
+ :where(hr) {
61
+ /* Add the correct height in Firefox. */
62
+ height: 0;
63
+ /* Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) */
64
+ color: inherit;
65
+ /* Ensure horizontal rules are visible by default. */
66
+ border-top-width: 1px;
67
+ }
68
+
69
+ /* Add the correct text decoration in Chrome, Edge, and Safari. */
70
+ abbr:where([title]) {
71
+ text-decoration: underline dotted;
72
+ }
73
+
74
+ /* Avoid text overflows */
75
+ :where(p, h1, h2, h3, h4, h5, h6) {
76
+ overflow-wrap: break-word;
77
+ }
78
+
79
+ /* Remove the default font size and weight for headings. */
80
+ :where(h1, h2, h3, h4, h5, h6) {
81
+ font-size: inherit;
82
+ font-weight: inherit;
83
+ }
84
+
85
+ /* Reset links to optimize for opt-in styling instead of opt-out. */
86
+ :where(a) {
87
+ color: inherit;
88
+ text-decoration: inherit;
89
+ }
90
+
91
+ /* Add the correct font weight in Edge and Safari. */
92
+ :where(b, strong) {
93
+ font-weight: bolder;
94
+ }
95
+
96
+ /* Use the user's configured `mono` font family by default. */
97
+ :where(code, kbd, samp, pre) {
98
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
99
+ 'Liberation Mono', 'Courier New', monospace; /* 1 */
100
+ /* Correct the odd `em` font sizing in all browsers. */
101
+ font-size: 1em; /* 2 */
102
+ }
103
+
104
+ /* Add the correct font size in all browsers. */
105
+ :where(small) {
106
+ font-size: 80%;
107
+ }
108
+
109
+ /* Prevent `sub` and `sup` elements from affecting the line height in all browsers. */
110
+ :where(sub, sup) {
111
+ font-size: 75%;
112
+ line-height: 0;
113
+ position: relative;
114
+ vertical-align: baseline;
115
+ }
116
+
117
+ :where(sub) {
118
+ bottom: -0.25em;
119
+ }
120
+
121
+ :where(sup) {
122
+ top: -0.5em;
123
+ }
124
+
125
+ :where(table) {
126
+ /* Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) */
127
+ text-indent: 0;
128
+ /* Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) */
129
+ border-color: inherit;
130
+ /* Remove gaps between table borders by default. */
131
+ border-collapse: collapse;
132
+ }
133
+
134
+ /* Change the font styles in all browsers. */
135
+ :where(button, input, optgroup, select, textarea),
136
+ :where(input[type="file"])::-webkit-file-upload-button {
137
+ font-family: inherit;
138
+ font-size: 100%;
139
+ line-height: inherit;
140
+ color: inherit;
141
+ font: inherit;
142
+ font-size: inherit;
143
+ }
144
+
145
+ /* Remove the inheritance of text transform in Edge and Firefox. */
146
+ :where(button, select) {
147
+ text-transform: none;
148
+ }
149
+
150
+ :where(button, [type='button'], [type='reset'], [type='submit']) {
151
+ /* Correct the inability to style clickable types in iOS and Safari. */
152
+ -webkit-appearance: button;
153
+ /* Remove default button styles. */
154
+ background-color: transparent;
155
+ background-image: none;
156
+ }
157
+
158
+ /* Use the modern Firefox focus style for all focusable elements. */
159
+ :where(:-moz-focusring) {
160
+ outline: auto;
161
+ }
162
+
163
+ /* Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) */
164
+ :where(:-moz-ui-invalid) {
165
+ box-shadow: none;
166
+ }
167
+
168
+ /* Add the correct vertical alignment in Chrome and Firefox. */
169
+ :where(progress) {
170
+ vertical-align: baseline;
171
+ }
172
+
173
+ /* Correct the cursor style of increment and decrement buttons in Safari. */
174
+ :where(::-webkit-inner-spin-button, ::-webkit-outer-spin-button) {
175
+ height: auto;
176
+ }
177
+
178
+ :where([type='search']) {
179
+ /* Correct the odd appearance in Chrome and Safari. */
180
+ -webkit-appearance: textfield;
181
+ /* Correct the outline style in Safari. */
182
+ outline-offset: -2px;
183
+ }
184
+
185
+ /* Remove the inner padding in Chrome and Safari on macOS. */
186
+ :where(::-webkit-search-decoration) {
187
+ -webkit-appearance: none;
188
+ }
189
+
190
+ :where(::-webkit-file-upload-button) {
191
+ /* Correct the inability to style clickable types in iOS and Safari. */
192
+ -webkit-appearance: button;
193
+ /* Change font properties in Safari. */
194
+ font: inherit;
195
+ }
196
+
197
+ /* Add the correct display in Chrome and Safari. */
198
+ :where(summary) {
199
+ display: list-item;
200
+ }
201
+
202
+ /* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
203
+ :where(ul, ol, menu)[role="list"] {
204
+ list-style: none;
205
+ }
206
+
207
+ /* Change textarea resize to vertical only and block only if the browser supports that */
208
+ :where(textarea) {
209
+ resize: vertical;
210
+ }
211
+ @supports (resize: block) {
212
+ :where(textarea) {
213
+ resize: block;
214
+ }
215
+ }
216
+
217
+ :where(input::placeholder, textarea::placeholder) {
218
+ /* Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) */
219
+ opacity: 1;
220
+ /* Set the default placeholder color to the user's configured gray 400 color. */
221
+ color: #9ca3af;
222
+ }
223
+
224
+ /* Set the default cursor for buttons. */
225
+ :where(button, [role='button']) {
226
+ cursor: pointer;
227
+ }
228
+
229
+ /* Make sure users can't select button text */
230
+ :where(button, button[type], input[type="button"], input[type="submit"], input[type="reset"]),
231
+ :where(input[type="file"])::-webkit-file-upload-button,
232
+ :where(input[type="file"])::file-selector-button {
233
+ -webkit-tap-highlight-color: transparent;
234
+ -webkit-touch-callout: none;
235
+ user-select: none;
236
+ text-align: center;
237
+ }
238
+
239
+ /* Disabled cursor for disabled buttons */
240
+ :where(button, button[type], input[type="button"], input[type="submit"], input[type="reset"])[disabled] {
241
+ cursor: not-allowed;
242
+ }
243
+
244
+ :where(img, svg, video, canvas, audio, iframe, embed, object) {
245
+ /* Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) */
246
+ display: block;
247
+ /* Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
248
+ This can trigger a poorly considered lint error in some tools but is included by design. */
249
+ vertical-align: middle; /* 2 */
250
+ }
251
+
252
+ /* Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) */
253
+ :where(img, video) {
254
+ max-width: 100%;
255
+ height: auto;
256
+ }
257
+
258
+ :where(img, svg, video) {
259
+ block-size: auto;
260
+ max-inline-size: 100%;
261
+ }
262
+
263
+ /* More readable underline style for anchor tags without a class. This could be set on anchor tags globally, but it can cause conflicts. */
264
+ a:not([class]) {
265
+ text-decoration-skip-ink: auto;
266
+ }
267
+
268
+ /* Make it clear that interactive elements are interactive */
269
+ :where(a[href], area, button, input, label[for], select, summary, textarea, [tabindex]:not([tabindex*="-"])) {
270
+ cursor: pointer;
271
+ touch-action: manipulation;
272
+ }
273
+ :where(input[type="file"]) {
274
+ cursor: auto;
275
+ }
276
+ :where(input[type="file"])::-webkit-file-upload-button,
277
+ :where(input[type="file"])::file-selector-button {
278
+ cursor: pointer;
279
+ }
280
+
281
+ /* Ensure the default browser behavior of the `hidden` attribute. */
282
+ :where([hidden]) {
283
+ display: none;
284
+ }
285
+
286
+ /* Remove stroke and set fill colour to the inherited font colour */
287
+ :where(svg) {
288
+ stroke: none;
289
+ fill: currentColor;
290
+ }
291
+
292
+ /* SVG's without a fill attribute */
293
+ :where(svg):where(:not([fill])) {
294
+ /* Remove fill and set stroke colour to the inherited font colour */
295
+ stroke: currentColor;
296
+ fill: none;
297
+ /* Rounded stroke */
298
+ stroke-linecap: round;
299
+ stroke-linejoin: round;
300
+ }
301
+
302
+ /* Set a size for SVG's without a width attribute */
303
+ :where(svg):where(:not([width])) {
304
+ inline-size: 5rem;
305
+ }
306
+
307
+ /* Animate focus outline */
308
+ @media (prefers-reduced-motion: no-preference) {
309
+ :focus-visible {
310
+ transition: outline-offset 145ms cubic-bezier(0.25, 0, 0.4, 1);
311
+ }
312
+ :where(:not(:active)):focus-visible {
313
+ transition-duration: 0.25s;
314
+ }
315
+ }
316
+ :where(:not(:active)):focus-visible {
317
+ outline-offset: 5px;
318
+ }