Skip to content

Commit

Permalink
fix: made transformers not part of the preset
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Milfred committed Sep 24, 2024
1 parent a86d83e commit 2ca095b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .playground/uno.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { defineConfig } from 'unocss';
import presetCore from '../assets/js/unocss/preset-core.mjs';
import breakpoints from './assets/js/breakpoints.cjs';
import transformerVariantGroup from '@unocss/transformer-variant-group';
import transformerDirectives from '../assets/js/unocss/TransformerDirectives/index.mjs';

export default defineConfig({
presets: [presetCore({ breakpoints })],
transformers: [transformerVariantGroup(), transformerDirectives()],

theme: {
colors: {
Expand Down
14 changes: 4 additions & 10 deletions assets/js/unocss/preset-core.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { definePreset } from 'unocss';

import presetWind from '@unocss/preset-wind';
import presetNoDefaultRem from './preset-no-default-rem.mjs';

import transformerVariantGroup from '@unocss/transformer-variant-group';
import transformerDirectives from './TransformerDirectives/index.mjs';

function presetCore(options = {}) {
const presetCore = definePreset((options = {}) => {
// Assign to the default options
options = Object.assign(
{
Expand Down Expand Up @@ -72,11 +71,6 @@ function presetCore(options = {}) {

name: 'preset-core',

transformers: [
...(wind.transformers || []),
transformerVariantGroup(),
transformerDirectives(),
],
presets: [...(wind.presets || []), presetNoDefaultRem()],

theme: {
Expand Down Expand Up @@ -275,7 +269,7 @@ function presetCore(options = {}) {
},
],
};
}
});

export default presetCore;
export { presetCore };

0 comments on commit 2ca095b

Please sign in to comment.