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

at-rule or selector expectedcss(css-ruleorselectorexpected) validation error display for styles beginning ">>>" #1924

Closed
simonbrent opened this issue May 20, 2020 · 10 comments
Labels

Comments

@simonbrent
Copy link

simonbrent commented May 20, 2020

Info

  • Platform: Windows 10
  • Vetur version: 0.24.0
  • VS Code version: 1.45.1

Problem

at-rule or selector expectedcss(css-ruleorselectorexpected) validation error display for styles beginning ">>>"

Reproducible Case

Create a .vue file with the following style block:

<style scoped>
  >>> .foo { display: block; }
</style>

Open the file in VS Code - you will see the error "at-rule or selector expectedcss(css-ruleorselectorexpected)"

Disable the Veture > Validation: Style setting and reload VS Code - the error will no longer be present.

@octref
Copy link
Member

octref commented Jun 8, 2020

There's no support for non-standard CSS features.

@octref octref closed this as completed Jun 8, 2020
@octref octref added the wontfix label Jun 8, 2020
@simonbrent
Copy link
Author

But this is the documented way to do deep selectors for scoped style:
https://vue-loader.vuejs.org/guide/scoped-css.html#deep-selectors

Should I be doing * >>> .foo { display: block; } instead?

@octref
Copy link
Member

octref commented Aug 4, 2020

From what I see you need to have a selector before and after >>>. What's the grammar for >>>?

@simonbrent
Copy link
Author

https://vue-loader.vuejs.org/guide/scoped-css.html#deep-selectors is the only place I've seen it officially documented, which doesn't define whether you must have a selector before and after. However, I know that not having a selector before does work, since my code behaves as expected.

@octref
Copy link
Member

octref commented Aug 25, 2020

You can try your luck by opening an issue here: https://github.com/microsoft/vscode-css-languageservice, but I doubt they'd make the change to accommodate non-standard CSS. Vetur uses it and it parses standard CSS/SCSS/Less.

@rchl
Copy link
Collaborator

rchl commented Aug 25, 2020

You can use /deep/ instead.

@frederikheld
Copy link

frederikheld commented Jan 17, 2021

Same issue with /deep/. I tried to disable the rule with /* eslint-disable-next-line */ but no luck: eslint/eslint#11138

As /deep/ and/or >>> seem to be a (somehow hidden but) very important feature of Vue, it would be great to have eslint support or at least the option to use disable-nextline...

@simonbrent
Copy link
Author

FYI ::v-deep appears to work without an error (for now...)

@DMOAbove
Copy link

I am getting this error with this:

:deep(.select-input) {
    .dropdown-container {
      @apply bg-dark-stone #{!important};
      .dropdown-menu {
        .dropdown-input-select-item {
          &:hover {
            @apply text-white #{!important};
          }
        }
      }
    } <- gives error here

Seems related with interpolating the important from tailwind. If I remove both importants the error doesn't happen.

@dcvermeer
Copy link

@Keyframes slideFromLeft7 {
0% {
width: 0;
}
100% {
width: %;
}
} <---- gives a "at-rule or selector expectedcss(css-ruleorselectorexpected)"
i have no clue how to fix it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants