Skip to content

feat: Allow custom syntax#47

Merged
mdjermanovic merged 6 commits into
mainfrom
issue37
Feb 14, 2025
Merged

feat: Allow custom syntax#47
mdjermanovic merged 6 commits into
mainfrom
issue37

Conversation

@nzakas

@nzakas nzakas commented Jan 21, 2025

Copy link
Copy Markdown
Member

Prerequisites checklist

What is the purpose of this pull request?

Adds support for custom syntax to the parser.

What changes did you make? (Give an overview)

  • Added languageOptions.customSyntax to CSSLanguage
  • Updated rules to use custom syntax
  • Updated tests for CSSLanguage and rules
  • Updated README
  • Added /syntax entrypoint for common custom syntax like Tailwind

Related Issues

fixes #37

Is there anything you'd like reviewers to focus on?

There is a limitation in CSSTree that prevents custom functions like Tailwind's theme() to work properly, so I left that out:
csstree/csstree#292

When that issue is resolved, we can revisit.

@fasttime fasttime left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There's a merge conflict.

Comment thread src/syntax/tailwind-syntax.js Outdated
@fasttime fasttime added the accepted There is consensus among the team that this change meets the criteria for inclusion label Feb 4, 2025
Comment thread src/syntax/tailwind-syntax.js Outdated
Comment thread package.json
Comment thread package.json
Comment thread tests/rules/no-invalid-at-rules.test.js Outdated
Comment thread tests/rules/no-invalid-at-rules.test.js
@mdjermanovic

Copy link
Copy Markdown
Member
  • Updated tests for CSSLanguage

There are currently no updates in tests for CSSLanguage, maybe some commits are missing?

@nzakas

nzakas commented Feb 13, 2025

Copy link
Copy Markdown
Member Author

I didn't include any additional tests for CSSLanguage because the new functionality can only really be tested by running the rule to validate syntax.

I did add a test that shows the new option throws when invalid.

@mdjermanovic mdjermanovic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit 397888b into main Feb 14, 2025
@mdjermanovic mdjermanovic deleted the issue37 branch February 14, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted There is consensus among the team that this change meets the criteria for inclusion feature

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Change Request: Allow configurable CSS features

3 participants