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

Not Working in HTML Inline Styles #5999

Closed
MarkSky opened this issue Mar 30, 2022 · 2 comments
Closed

Not Working in HTML Inline Styles #5999

MarkSky opened this issue Mar 30, 2022 · 2 comments

Comments

@MarkSky
Copy link

MarkSky commented Mar 30, 2022

What steps are needed to reproduce the bug?

step Stylelint configuration and run Styelint in CLI.

What Stylelint configuration is needed to reproduce the bug?

json
{
    "extends": ["stylelint-config-standard"],
    "plugins": ["stylelint-order"],
    "rules": {
        "custom-property-empty-line-before": [
            "always",
            {
                "except": ["after-comment", "after-custom-property", "first-nested"],
                "ignore": ["after-comment", "inside-single-line-block"]
            }
        ],
    },
    "overrides": [
        {
            "files": ["**/*.vue"],
            "customSyntax": "postcss-html",
            "extends": ["stylelint-config-recommended-vue", "stylelint-config-standard-scss", "stylelint-config-recommended-vue/scss"]
        }
    ]
}

How did you run Stylelint?

CLI with `stylelint src/views/SamplePage.vue --config .stylelintrc'

Which version of Stylelint are you using?

14.6.1

What did you expect to happen?

<div class="home-container"
     style="--text-color: #1352ba;">
    Sample
</div>

What actually happened?

<div class="home-container"
     style="

--text-color: #1352ba;">
    Sample
</div>

Does the bug relate to non-standard syntax?

No response

Proposal to fix the bug

No response

@MarkSky MarkSky changed the title Not Working in HTML Style Attribute Not Working in HTML Inline Styles Mar 30, 2022
@jeddy3
Copy link
Member

jeddy3 commented Mar 30, 2022

@MarkSky Thanks for the report and for using the template.

The stylistic rules are frozen. We recommend enforcing whitespace conventions using a pretty printer like Prettier alongside Stylelint.

Alternatively, you can:

  • see if the postcss-html maintainers can do something so that style="--text-color: #1352ba;"> is represented as a single-line block in the AST
  • port custom-property-empty-line-before to a plugin and add syntax-specific logic to it

@jeddy3 jeddy3 closed this as completed Mar 30, 2022
@MarkSky
Copy link
Author

MarkSky commented Mar 31, 2022

I understand. Thank you.
Will these rules remove from standard rules in the future version?

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

No branches or pull requests

2 participants