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

Use custom datasets for properties, at-properties, pseudo-classes and pesudo-elements. #1467

Open
3 tasks done
nuochong opened this issue Oct 19, 2019 · 0 comments
Open
3 tasks done

Comments

@nuochong
Copy link

nuochong commented Oct 19, 2019

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: Mac OS
  • Vetur version: 0.22.4
  • VS Code version: 1.39.2

Problem

The custom properties of the style cannot be used in the vue file

Reproducible Case

settings.json

{
  "css.customData": ["./css.css-data.json"]
}

css.css-data.json

{
  "version": 1.1,
  "properties": [{
    "name": "my-size",
    "description": "Compiles down to `width` and `height`. See details at https://github.com/postcss/postcss-size",
    "references": [
      {
        "name": "GitHub",
        "url": "https://github.com/postcss/postcss-size"
      }
    ]
  }],
  "pseudoClasses": [{
    "name": ":my-link",
    "description": ":any-link pseudo class. See details at https://preset-env.cssdb.org/features#any-link-pseudo-class"
  }]
}

test.scss

button{
  color:red;
  my-size:4px;
}

In test.scss, the 'my-size' property prompts normally

Correct message

Compiles down to width and height. See details at 
https://github.com/postcss/postcss-size
GitHub

test.vue

<template>
<div>
</div>
</template>

<script>
</script>

<style scoped lang="scss">
button{
  color:red;
  my-size:4px;
}
</style>

However, the 'my-size' property is incorrect in test.vue, and the custom style property cannot be used.

Error message

Unknown property: 'my-size'css(unknownProperties)

Information related to this issue

vscode-css-languageservice/changelog.md

4.0.0 / 2019-06-12
`LanguageServiceOptions.customDataProviders` allows you to use custom datasets for properties, at-properties, pseudo-classes and pesudo-elements.
New API LanguageService.getSelectionRanges

customData.schema.json

vscode-custom-data

vscode-css-languageservice/docs/customData.md

vscode-custom-data/samples/helloworld

@nuochong nuochong changed the title use custom datasets for properties, at-properties, pseudo-classes and pesudo-elements. Use custom datasets for properties, at-properties, pseudo-classes and pesudo-elements. Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants