Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for declarations #2468

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add support for declarations #2468

wants to merge 3 commits into from

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Dec 19, 2024

No description provided.

pkg/sass-parser/lib/src/statement/declaration.ts Outdated Show resolved Hide resolved
pkg/sass-parser/lib/src/statement/declaration.ts Outdated Show resolved Hide resolved
pkg/sass-parser/lib/src/statement/declaration.test.ts Outdated Show resolved Hide resolved
Comment on lines +293 to +309
it('ignores important', () =>
expect(
new Declaration({
prop: 'foo',
value: 'bar !important',
raws: {important: '!IMPORTANT'},
}).toString(),
).toBe('foo: bar !important'));

it('ignores value', () =>
expect(
new Declaration({
prop: 'foo',
value: 'bar',
raws: {value: {value: 'bar', raw: 'BAR'}},
}).toString(),
).toBe('foo: bar'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slightly lost, why is !important and value ignored?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because in the Sass AST, those are fully parsed expressions in their own right, and the expression ASTs determine how they're serialized rather than the statement-level raws.

@nex3 nex3 requested a review from Goodwine December 24, 2024 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants