Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot committed Sep 10, 2024
1 parent 2707b7d commit 805e39c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/pigment-css-unplugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
} from '@pigment-css/react/utils';
import type { ResolvePluginInstance } from 'webpack';
import { styledEngineMockup } from '@pigment-css/react/internal';

import { handleUrlReplacement, type AsyncResolver } from './utils';

type NextMeta = {
Expand Down Expand Up @@ -287,10 +286,14 @@ export const plugin = createUnplugin<PigmentOptions, true>((options) => {

const slug = slugify(cssText);

// Valid names must start with a underscore or letter.
const layerName = `_${slug}`;

// TODO: Do this in a way that keeps the source map correct
cssText = `
@layer _${slug} {
@layer pigment.${layerName} {
${cssText}
}
}
`;

if (isNext && !outputCss) {
Expand Down

0 comments on commit 805e39c

Please sign in to comment.