Skip to content

Commit 043f130

Browse files
committed
Add tests for comments inside @theme
1 parent 9e9d093 commit 043f130

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

packages/tailwindcss-language-syntax/tests/__snapshots__/syntax.test.ts.snap

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,71 @@ exports[`@theme 1`] = `
873873
874874
}
875875
^^ 1: source.css.tailwind
876+
877+
878+
^ 1: source.css.tailwind
879+
880+
@theme {
881+
^^^^^^^^ 4: source.css.tailwind
882+
^^^^^^ 2: keyword.control.at-rule.theme.tailwind
883+
^ 1: punctuation.definition.keyword.css
884+
^ 1: meta.at-rule.theme.body.tailwind punctuation.section.theme.begin.bracket.curly.tailwind
885+
886+
/** Comment 0 */
887+
^^^^^^^^^^^^^^^^^^^ 3: source.css.tailwind meta.at-rule.theme.body.tailwind
888+
^^^^^^^ 1: meta.property-name.css
889+
890+
891+
^ 1: source.css.tailwind meta.at-rule.theme.body.tailwind
892+
893+
/** Comment 1 */
894+
^^^^^^^^^^^^^^^^^^^ 3: source.css.tailwind meta.at-rule.theme.body.tailwind
895+
^^^^^^^ 1: meta.property-name.css
896+
897+
--color-1: red;
898+
^^^^^^^^^^^^^^^^^ 7: source.css.tailwind meta.at-rule.theme.body.tailwind
899+
^^^^^^^^ 1: meta.property-name.css
900+
^ 1: punctuation.separator.key-value.css
901+
^^^ 1: meta.property-value.css support.constant.color.w3c-standard-color-name.css
902+
^ 1: punctuation.terminator.rule.css
903+
904+
905+
^ 1: source.css.tailwind meta.at-rule.theme.body.tailwind
906+
907+
/** Comment 2 */
908+
^^^^^^^^^^^^^^^^^^^ 3: source.css.tailwind meta.at-rule.theme.body.tailwind
909+
^^^^^^^ 1: meta.property-name.css
910+
911+
--color-2: green;
912+
^^^^^^^^^^^^^^^^^^^ 7: source.css.tailwind meta.at-rule.theme.body.tailwind
913+
^^^^^^^^ 1: meta.property-name.css
914+
^ 1: punctuation.separator.key-value.css
915+
^^^^^ 1: meta.property-value.css support.constant.color.w3c-standard-color-name.css
916+
^ 1: punctuation.terminator.rule.css
917+
918+
919+
^ 1: source.css.tailwind meta.at-rule.theme.body.tailwind
920+
921+
/** Comment 3 */
922+
^^^^^^^^^^^^^^^^^^^ 3: source.css.tailwind meta.at-rule.theme.body.tailwind
923+
^^^^^^^ 1: meta.property-name.css
924+
925+
--color-2: blue;
926+
^^^^^^^^^^^^^^^^^^ 7: source.css.tailwind meta.at-rule.theme.body.tailwind
927+
^^^^^^^^ 1: meta.property-name.css
928+
^ 1: punctuation.separator.key-value.css
929+
^^^^ 1: meta.property-value.css support.constant.color.w3c-standard-color-name.css
930+
^ 1: punctuation.terminator.rule.css
931+
932+
933+
^ 1: source.css.tailwind meta.at-rule.theme.body.tailwind
934+
935+
/** Comment 4 */
936+
^^^^^^^^^^^^^^^^^^^ 3: source.css.tailwind meta.at-rule.theme.body.tailwind
937+
^^^^^^^ 1: meta.property-name.css
938+
939+
}
940+
^ 1: source.css.tailwind meta.at-rule.theme.body.tailwind punctuation.section.theme.end.bracket.curly.tailwind
876941
"
877942
`;
878943

packages/tailwindcss-language-syntax/tests/syntax.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ test('@theme', async ({ expect }) => {
3636
}
3737
}
3838
}
39+
40+
@theme {
41+
/** Comment 0 */
42+
43+
/** Comment 1 */
44+
--color-1: red;
45+
46+
/** Comment 2 */
47+
--color-2: green;
48+
49+
/** Comment 3 */
50+
--color-2: blue;
51+
52+
/** Comment 4 */
53+
}
3954
`)
4055

4156
expect(result.toString()).toMatchSnapshot()

0 commit comments

Comments
 (0)