diff options
Diffstat (limited to 'packages/astro-parser/src')
-rw-r--r-- | packages/astro-parser/src/interfaces.ts | 2 | ||||
-rw-r--r-- | packages/astro-parser/src/parse/index.ts | 14 |
2 files changed, 2 insertions, 14 deletions
diff --git a/packages/astro-parser/src/interfaces.ts b/packages/astro-parser/src/interfaces.ts index 1e996027c..335643aa5 100644 --- a/packages/astro-parser/src/interfaces.ts +++ b/packages/astro-parser/src/interfaces.ts @@ -103,7 +103,7 @@ export interface Style extends BaseNode { export interface Ast { html: TemplateNode; - css: Style; + css: Style[]; module: Script; // instance: Script; meta: { diff --git a/packages/astro-parser/src/parse/index.ts b/packages/astro-parser/src/parse/index.ts index ef33bfaca..776d46e2b 100644 --- a/packages/astro-parser/src/parse/index.ts +++ b/packages/astro-parser/src/parse/index.ts @@ -226,18 +226,6 @@ export class Parser { export default function parse(template: string, options: ParserOptions = {}): Ast { const parser = new Parser(template, options); - // TODO we may want to allow multiple <style> tags — - // one scoped, one global. for now, only allow one - if (parser.css.length > 1) { - parser.error( - { - code: 'duplicate-style', - message: 'You can only have one <style> tag per Astro file', - }, - parser.css[1].start - ); - } - // const instance_scripts = parser.js.filter((script) => script.context === 'default'); // const module_scripts = parser.js.filter((script) => script.context === 'module'); const astro_scripts = parser.js.filter((script) => script.context === 'setup'); @@ -264,7 +252,7 @@ export default function parse(template: string, options: ParserOptions = {}): As return { html: parser.html, - css: parser.css[0], + css: parser.css, // instance: instance_scripts[0], module: astro_scripts[0], meta: { |