facebook

CSS editor: Auto-formatting corrupts CSS variable

  1. MyEclipse IDE
  2.  > 
  3. General Development

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #671401 Reply

    guyrevision-ca
    Participant

    Using the formatting feature (CTRL-Shift-F keyboard shortcut) to format the CSS source corrupts CSS variables.

    CSS source before formatting:

    :root {
        --scrollbar-width: 2em;
    }
    
    .btnX {
        right: calc(10px + var(--scrollbar-width));
    }

    Pressing CTRL-Shift-F changes the above to:

    :root { -
    	-scrollbar-width: 2em;
    }
    
    .btnX {
    	right: calc(10px + var(- -scrollbar-width));
    }

    Problems:

    • The first hyphen is moved up, so the variable declaration is broken.
    • The var() reference is also broken due to a space added between hyphens.

    I have searched Eclipse bug tracker and found the following issue about the same exact issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=492844

    Please consider fixing,

    GR.

    #671402 Reply

    guyrevision-ca
    Participant

    Workaround: using former CSS variables syntax (var-scrollbar-width instead of –scrollbar-width).

    Since this former syntax is deprecated, it’s not an option for the long term.

    GR.

    #671458 Reply

    support-swapna
    Moderator

    Hi,

    Sorry that you are seeing this issue with the auto formatting of CSS. Thank you for pointing to the Eclipse bug report.
    I have filed an internal report to track the Eclipse bug and will check with the dev team if we can fix it at our end.
    We will keep you posted about it.

    Apologies for inconvenience caused.

    –Swapna
    Genuitec Support

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: CSS editor: Auto-formatting corrupts CSS variable

You must be logged in to post in the forum log in