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

Unsupport official screen() function syntax #1079

Open
ngdangtu-vn opened this issue Oct 26, 2024 · 0 comments
Open

Unsupport official screen() function syntax #1079

ngdangtu-vn opened this issue Oct 26, 2024 · 0 comments

Comments

@ngdangtu-vn
Copy link

ngdangtu-vn commented Oct 26, 2024

What version of VS Code are you using? 1.94.2

What version of Tailwind CSS IntelliSense are you using? v0.12.11

What version of Tailwind CSS are you using? ^3.4.14"

What package manager are you using? bun

What operating system are you using? Linux

Tailwind config

import type { Config } from "tailwindcss"
import type { KeyValuePair, ScreensConfig } from "tailwindcss/types/config"

import c from "tailwindcss/colors"

/**
 * Viewport Thresholds
 * @ref https://ihax.io/display-resolution-explained
 */
const thresholds: ScreensConfig = {
   // default: xs is phone = 320px
   // ...
}

/**
 * Color Palette
 */
const palette = {
   inherit: 'inherit',
   // ...
}


/**
 * Typography
 */
const typography: KeyValuePair<string, Typography> = {
   'base-xs': ['var(--fz-base-xs)', { fontWeight: 400, lineHeight: '1.25', letterSpacing: 'normal' }],
   // ...
}
type Typography = [
   size: string,
   config: Partial<{
      lineHeight: string
      letterSpacing: string
      fontWeight: string | number
   }>
]

export default {
   content: [
      "./index.html",
      "./src/**/*.{ts,tsx}",
   ],
   theme: {
      screens: thresholds,
      colors: palette,
      fontWeight: {
         lighter: '200',
         // ...
      },
      fontSize: typography,
      extend: {},
   },
   darkMode: ['selector', '[data-palette="dark"]'],
   plugins: [],
} as Config

VS Code settings

{
   "diffEditor.ignoreTrimWhitespace": false,
   "editor.detectIndentation": false,
   "editor.formatOnSave": true,
   "editor.inlayHints.enabled": "offUnlessPressed",
   "editor.tabSize": 3,
   "git.autofetch": true,
   "json.format.keepLines": true,
   "tailwindCSS.emmetCompletions": true,
   "typescript.check.npmIsInstalled": false,
   "typescript.disableAutomaticTypeAcquisition": true,
   "typescript.experimental.updateImportsOnPaste": true,
   "typescript.format.placeOpenBraceOnNewLineForControlBlocks": true,
   "typescript.format.placeOpenBraceOnNewLineForFunctions": true,
   "typescript.format.semicolons": "remove",
   "typescript.implementationsCodeLens.enabled": true,
   "typescript.implementationsCodeLens.showOnInterfaceMethods": true,
   "typescript.inlayHints.enumMemberValues.enabled": true,
   "typescript.inlayHints.functionLikeReturnTypes.enabled": true,
   "typescript.inlayHints.parameterNames.enabled": "literals",
   "typescript.inlayHints.propertyDeclarationTypes.enabled": true,
   "typescript.inlayHints.variableTypes.enabled": true,
   "typescript.preferences.preferTypeOnlyAutoImports": true,
   "typescript.referencesCodeLens.showOnAllFunctions": true,
   "typescript.tsserver.maxTsServerMemory": 2048,
   "typescript.validate.enable": true,
   "workbench.sideBar.location": "right"
}

Reproduction URL

No need just follow the document → https://tailwindcss.com/docs/functions-and-directives#screen

Describe your issue

Finally, I allow to speak up now. First let take a look at this screenshot:

image

While from the document about the screen() function, it should be fine. But the editor keeps firing error from the syntax which somewhat bugs me badly. Since this is official vscode plugin for TailwindCSS, I think it is reasonable to consider this is a bug.

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

No branches or pull requests

1 participant