You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/tailwindcss-language-server/src/providers/completionProvider.ts
+41-20Lines changed: 41 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@ import { getDocumentSettings } from '../util/getDocumentSettings'
22
22
import{isJsContext}from'../util/js'
23
23
import{naturalExpand}from'../util/naturalExpand'
24
24
importsemverfrom'semver'
25
+
import{docsUrl}from'../util/docsUrl'
25
26
26
27
functioncompletionsFromClassList(
27
28
state: State,
@@ -337,40 +338,50 @@ function provideTailwindDirectiveCompletions(
337
338
label: 'base',
338
339
documentation: {
339
340
kind: MarkupKind.Markdown,
340
-
value:
341
-
'This injects Tailwind’s base styles and any base styles registered by plugins.\n\n[Tailwind CSS Documentation](https://tailwindcss.com/docs/functions-and-directives/#tailwind)',
341
+
value: `This injects Tailwind’s base styles and any base styles registered by plugins.\n\n[Tailwind CSS Documentation](${docsUrl(
342
+
state.version,
343
+
'functions-and-directives/#tailwind'
344
+
)})`,
342
345
},
343
346
}
344
347
: {
345
348
label: 'preflight',
346
349
documentation: {
347
350
kind: MarkupKind.Markdown,
348
-
value:
349
-
'This injects Tailwind’s base styles, which is a combination of Normalize.css and some additional base styles.\n\n[Tailwind CSS Documentation](https://v0.tailwindcss.com/docs/functions-and-directives/#tailwind)',
351
+
value: `This injects Tailwind’s base styles, which is a combination of Normalize.css and some additional base styles.\n\n[Tailwind CSS Documentation](${docsUrl(
352
+
state.version,
353
+
'functions-and-directives/#tailwind'
354
+
)})`,
350
355
},
351
356
},
352
357
{
353
358
label: 'components',
354
359
documentation: {
355
360
kind: MarkupKind.Markdown,
356
-
value:
357
-
'This injects Tailwind’s component classes and any component classes registered by plugins.\n\n[Tailwind CSS Documentation](https://tailwindcss.com/docs/functions-and-directives/#tailwind)',
361
+
value: `This injects Tailwind’s component classes and any component classes registered by plugins.\n\n[Tailwind CSS Documentation](${docsUrl(
362
+
state.version,
363
+
'functions-and-directives/#tailwind'
364
+
)})`,
358
365
},
359
366
},
360
367
{
361
368
label: 'utilities',
362
369
documentation: {
363
370
kind: MarkupKind.Markdown,
364
-
value:
365
-
'This injects Tailwind’s utility classes and any utility classes registered by plugins.\n\n[Tailwind CSS Documentation](https://tailwindcss.com/docs/functions-and-directives/#tailwind)',
371
+
value: `This injects Tailwind’s utility classes and any utility classes registered by plugins.\n\n[Tailwind CSS Documentation](${docsUrl(
372
+
state.version,
373
+
'functions-and-directives/#tailwind'
374
+
)})`,
366
375
},
367
376
},
368
377
{
369
378
label: 'screens',
370
379
documentation: {
371
380
kind: MarkupKind.Markdown,
372
-
value:
373
-
'Use this directive to control where Tailwind injects the responsive variations of each utility.\n\nIf omitted, Tailwind will append these classes to the very end of your stylesheet by default.\n\n[Tailwind CSS Documentation](https://tailwindcss.com/docs/functions-and-directives/#tailwind)',
381
+
value: `Use this directive to control where Tailwind injects the responsive variations of each utility.\n\nIf omitted, Tailwind will append these classes to the very end of your stylesheet by default.\n\n[Tailwind CSS Documentation](${docsUrl(
382
+
state.version,
383
+
'functions-and-directives/#tailwind'
384
+
)})`,
374
385
},
375
386
},
376
387
].map((item)=>({
@@ -511,40 +522,50 @@ function provideCssDirectiveCompletions(
511
522
label: '@tailwind',
512
523
documentation: {
513
524
kind: MarkupKind.Markdown,
514
-
value:
515
-
'Use the `@tailwind` directive to insert Tailwind’s `base`, `components`, `utilities` and `screens` styles into your CSS.\n\n[Tailwind CSS Documentation](https://tailwindcss.com/docs/functions-and-directives#tailwind)',
525
+
value: `Use the \`@tailwind\` directive to insert Tailwind’s \`base\`, \`components\`, \`utilities\` and \`screens\` styles into your CSS.\n\n[Tailwind CSS Documentation](${docsUrl(
526
+
state.version,
527
+
'functions-and-directives/#tailwind'
528
+
)})`,
516
529
},
517
530
},
518
531
{
519
532
label: '@variants',
520
533
documentation: {
521
534
kind: MarkupKind.Markdown,
522
-
value:
523
-
'You can generate `responsive`, `hover`, `focus`, `active`, and `group-hover` versions of your own utilities by wrapping their definitions in the `@variants` directive.\n\n[Tailwind CSS Documentation](https://tailwindcss.com/docs/functions-and-directives#variants)',
535
+
value: `You can generate \`responsive\`, \`hover\`, \`focus\`, \`active\`, and \`group-hover\` versions of your own utilities by wrapping their definitions in the \`@variants\` directive.\n\n[Tailwind CSS Documentation](${docsUrl(
536
+
state.version,
537
+
'functions-and-directives/#variants'
538
+
)})`,
524
539
},
525
540
},
526
541
{
527
542
label: '@responsive',
528
543
documentation: {
529
544
kind: MarkupKind.Markdown,
530
-
value:
531
-
'You can generate responsive variants of your own classes by wrapping their definitions in the `@responsive` directive.\n\n[Tailwind CSS Documentation](https://tailwindcss.com/docs/functions-and-directives#responsive)',
545
+
value: `You can generate responsive variants of your own classes by wrapping their definitions in the \`@responsive\` directive.\n\n[Tailwind CSS Documentation](${docsUrl(
546
+
state.version,
547
+
'functions-and-directives/#responsive'
548
+
)})`,
532
549
},
533
550
},
534
551
{
535
552
label: '@screen',
536
553
documentation: {
537
554
kind: MarkupKind.Markdown,
538
-
value:
539
-
'The `@screen` directive allows you to create media queries that reference your breakpoints by name instead of duplicating their values in your own CSS.\n\n[Tailwind CSS Documentation](https://tailwindcss.com/docs/functions-and-directives#screen)',
555
+
value: `The \`@screen\` directive allows you to create media queries that reference your breakpoints by name instead of duplicating their values in your own CSS.\n\n[Tailwind CSS Documentation](${docsUrl(
556
+
state.version,
557
+
'functions-and-directives/#screen'
558
+
)})`,
540
559
},
541
560
},
542
561
{
543
562
label: '@apply',
544
563
documentation: {
545
564
kind: MarkupKind.Markdown,
546
-
value:
547
-
'Use `@apply` to inline any existing utility classes into your own custom CSS.\n\n[Tailwind CSS Documentation](https://tailwindcss.com/docs/functions-and-directives#apply)',
565
+
value: `Use \`@apply\` to inline any existing utility classes into your own custom CSS.\n\n[Tailwind CSS Documentation](${docsUrl(
0 commit comments