添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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
//** `<input>` background color

What stylelint configuration is needed to reproduce the bug?

https://github.com/twbs/bootstrap/blob/v3-dev/grunt/.stylelintrc

Which version of stylelint are you using?

C:\Users\xmr\Desktop\bootstrap>node -v && npm -v && npm ls stylelint && npm ls postcss-less
v10.15.3
6.4.1
[email protected] C:\Users\xmr\Desktop\bootstrap
`-- [email protected]
[email protected] C:\Users\xmr\Desktop\bootstrap
`-- [email protected]
  `-- [email protected]

How are you running stylelint: CLI, PostCSS plugin, Node.js API?

grunt-stylelint

Does the bug relate to non-standard syntax (e.g. SCSS, Less etc.)?

What did you expect to happen?

No warnings to be flagged.

What actually happened (e.g. what warnings or errors did you get)?

The following warnings were flagged:

Running "stylelint:dist" (stylelint) task
<input css 1>
 51:2  ×  Unknown word   CssSyntaxError

This happens in our v3-dev branch of https://github.com/twbs/bootstrap.git.

I tried a simple test and it seems it's not postcss-less to blame:

const { parse } = require('postcss-less');
const less = '//** `<input>` background color';
const result = parse(less);
console.log(result)

returns:

Root {
  raws: { semicolon: false, after: '' },
  type: 'root',
  nodes:
   [ Comment {
       raws: [Object],
       type: 'comment',
       parent: [Circular],
       source: [Object],
       inline: true,
       text: '** `<input>` background color' } ],
  source:
   { input:
      Input {
        css: '//** `<input>` background color',
        hasBOM: false,
        id: '<input css 1>' },
     start: { line: 1, column: 1 } } }

postcss-less issue: shellscape/postcss-less#138

I have same error on the comment like this: // Because CellInner has top padding that should be cleared

Full example:

export const Grid = styled.div`
  display: flex;
  padding-bottom: 20px;
  margin-top: -5px; // Because CellInner has top padding that should be cleared
  margin-bottom: -5px; // Because CellInner has bottom padding that should be cleared

package.json:

    "stylelint": "^13.0.0",
    "stylelint-config-standard": "^19.0.0",
    "stylelint-config-styled-components": "^0.1.1",
    "stylelint-processor-styled-components": "^1.9.0",

.stylelintrc:

"processors": ["stylelint-processor-styled-components"], "extends": [ "stylelint-config-standard", "stylelint-config-styled-components" "rules": { "declaration-empty-line-before": null

Do not use stylelint-processor-styled-components, stylelint supported CSS-in-JS out of box

/cc @stylelint/core We have a lot of issues with stylelint-processor-styled-components, previously I asked styled-component to add a deprecation into README, but no luck, any ideas how we can fix on our side/documentation?

I've picked this up in #3408.

BTW I haven't tested if this is still an issue since we don't use Less in >= v4.

I will close this issue as I can't reproduce the original problem using the demo.