Skip to content

Commit

Permalink
fix: remove resets from preflight and refactor (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaRybkina committed Jun 5, 2023
1 parent 8226c43 commit 3591a3b
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 486 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@

## plugin API

### usePreflight
### skipPreflight

- `boolean`
- Forces preflights to be included

### development

- `boolean`
- Will include preflights and base classes when true. These would be 'externalized' to Eik in production builds.
- Internal use only, omits preflights from the build

### usePixels

Expand Down
8 changes: 1 addition & 7 deletions dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ const {
type: 'string',
short: 'c',
},
development: {
type: 'boolean',
},
externalClasses: {
type: 'boolean',
},
Expand All @@ -23,13 +20,10 @@ const {
usePixels: {
type: 'boolean',
},
usePreflight: {
type: 'boolean',
},
},
});

const uno = createGenerator({ presets: [presetWarp( options )] });
const uno = createGenerator({ presets: [presetWarp( { ...options, skipPreflight: true } )] });
const devClasses = ['m-16!', 'opacity-50'];
const classes = cliClasses ?? devClasses;
const result = await uno.generate(classes);
Expand Down
33 changes: 0 additions & 33 deletions src/_preflights/headings.js

This file was deleted.

5 changes: 2 additions & 3 deletions src/_preflights/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { twReset } from './tw-reset.js';
import { transformBase } from './transform.js';
import { headingsBase } from './headings.js';
import { resets } from './resets.js';

export const preflights = [twReset, transformBase, headingsBase];
export const preflights = [transformBase, resets];
4 changes: 4 additions & 0 deletions src/_preflights/resets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const resets = {
layer: 'preflights',
getCSS: async () => (await fetch('https://assets.finn.no/pkg/@warp-ds/css/v1/resets.min.css')).text(),
};
Loading

0 comments on commit 3591a3b

Please sign in to comment.