Skip to content

Incorrect indentation #2135

Open
Open

Description

@TommyChen-orz

Description

1.Each time the format button is clicked, a tab is added in front of all lines.The script did not report an error

System Information

  • OS: Windows10
  • Browser: Chrome 149.0.7827.103
  • Stylus Version: 2.3.28

Screenshots, links, CSS

Image

Activity

  1. TommyChen-orz commented on Jun 15, 2026

    @TommyChen-orz
    Author

    This is the style file in question, with 27,000+ lines, and many inexplicable bugs often appear. Have you ever done any testing? How many lines of the file are the edge cases of stress?
    a.zip

  2. tophf commented on Jun 15, 2026

    @tophf
    Member

    The beautifier is outdated and since I don't use it myself I'm not interested in fixing it. If you can find a better one that's also small I would try to hook it up, otherwise maybe it's time to just remove this button.

  3. joes-mama commented on Jul 8, 2026

    @joes-mama

    @tophf I reckon keep the beautifier. With indent moz document on it works for my css and I can manually remove the moz document indentation myself after. It's still more useful than it is broken in my opinion

  4. tophf commented on Jul 29, 2026

    @tophf
    Member

    @TommyChen-orz, the CSS file you've attached has bugs in its structure e.g. family-name is declared outside of selector group right under @-moz-document which is invalid CSS, there are many selectors outside of @-moz-document which means they apply globally to all pages, there are also many @-moz-document incorrectly nested inside another @-moz-document. I guess our dumb beautifier gets conflicted feelings like Boulder. Also the built-in editor is not really suited for such big styles, better use a proper IDE + live reload.

  5. TommyChen-orz commented on Jul 30, 2026

    @TommyChen-orz
    Author

    @TommyChen-orz, the CSS file you've attached has bugs in its structure e.g. family-name is declared outside of selector group right under @-moz-document which is invalid CSS, there are many selectors outside of @-moz-document which means they apply globally to all pages, there are also many @-moz-document incorrectly nested inside another @-moz-document. I guess our dumb beautifier gets conflicted feelings like Boulder. Also the built-in editor is not really suited for such big styles, better use a proper IDE + live reload.


    The global styles written are intentional, because they are used in conjunction with other browser plug-ins. Those browser plug-ins are applied to all web pages, so the styles are written outside @-moz-document. Moreover, styles written outside @-moz-document also work. It turns out that this is not a reasonable function. I thought it was the writing method allowed by stylus by default... (The thing about "If the code can run, don’t change it" happened again LOL)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions