-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
597 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
pkg/sass-parser/lib/src/statement/__snapshots__/css-comment.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`a CSS-style comment toJSON 1`] = ` | ||
{ | ||
"inputs": [ | ||
{ | ||
"css": "/* foo */", | ||
"hasBOM": false, | ||
"id": "<input css _____>", | ||
}, | ||
], | ||
"raws": { | ||
"closed": true, | ||
"left": " ", | ||
"right": " ", | ||
}, | ||
"sassType": "comment", | ||
"source": <1:1-1:10 in 0>, | ||
"text": "foo", | ||
"textInterpolation": <foo>, | ||
"type": "comment", | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright 2024 Google Inc. Use of this source code is governed by an | ||
// MIT-style license that can be found in the LICENSE file or at | ||
// https://opensource.org/licenses/MIT. | ||
|
||
import * as postcss from 'postcss'; | ||
|
||
import {Root} from './root'; | ||
import {ChildNode, ChildProps, NewNode} from '.'; | ||
|
||
/** | ||
* A fake intermediate class to convince TypeScript to use Sass types for | ||
* various upstream methods. | ||
* | ||
* @hidden | ||
*/ | ||
export class _Comment< | ||
Props extends Partial<postcss.CommentProps>, | ||
> extends postcss.Comment { | ||
// Override the PostCSS types to constrain them to Sass types only. | ||
// Unfortunately, there's no way to abstract this out, because anything | ||
// mixin-like returns an intersection type which doesn't actually override | ||
// parent methods. See microsoft/TypeScript#59394. | ||
|
||
after(newNode: NewNode): this; | ||
assign(overrides: Partial<Props>): this; | ||
before(newNode: NewNode): this; | ||
cloneAfter(overrides?: Partial<Props>): this; | ||
cloneBefore(overrides?: Partial<Props>): this; | ||
next(): ChildNode | undefined; | ||
prev(): ChildNode | undefined; | ||
replaceWith( | ||
...nodes: ( | ||
| postcss.Node | ||
| ReadonlyArray<postcss.Node> | ||
| ChildProps | ||
| ReadonlyArray<ChildProps> | ||
)[] | ||
): this; | ||
root(): Root; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright 2024 Google Inc. Use of this source code is governed by an | ||
// MIT-style license that can be found in the LICENSE file or at | ||
// https://opensource.org/licenses/MIT. | ||
|
||
exports._Comment = require('postcss').Comment; |
Oops, something went wrong.