styleguidekit-assets-default icon indicating copy to clipboard operation
styleguidekit-assets-default copied to clipboard

Whitespace not preserved in code viewer

Open bmuenzenmeyer opened this issue 8 years ago • 4 comments

image

not sure if this is something on the CSS end @bradfrost but I sorta doubt it thoughts?

bmuenzenmeyer avatar Oct 06 '17 10:10 bmuenzenmeyer

What if the output was automatically beautified (both the HTML and template tags) before the files are written out to the file system?

That's what I ended up doing on the Drupal Pattern Lab / PHP side of things this past week to keep things simple while also not having things look like crap either.

sghoweri avatar Oct 08 '17 01:10 sghoweri

What if the output was automatically beautified (both the HTML and template tags) before the files are written out to the file system?

I think that's a smart option (and perhaps even a smart default), but I want to be mindful that some teams might have their code structured a certain way for certain reasons. Bulldozing their conventions might not be a good idea, so I'd say if we were to beautify things there would need to be a flag to turn it on/off.

bradfrost avatar Oct 08 '17 15:10 bradfrost

@bradfrost agreed - and I'm actually glad you brought up perhaps having this as a default (but with a config option to disable if need be so we aren't unintentionally introducing a breaking change without a workaround)

Perhaps we can tackle this once the CSS rearchitecture work is wrapped up?

sghoweri avatar Oct 08 '17 19:10 sghoweri

FWIW Pattern Lab Node does an automatic beautification and it was expensive and did trounce on people's styles. We do allow it be turned on and off with a flag. perhaps we could find an editorconfig-aware solution

whitespace not being preserved is different, IMO, that beautification. The current behavior is a bug. line breaks / carriage returns used to be preserved

labeling this "spec write up needed" as we should probably formalize this behavior

bmuenzenmeyer avatar Oct 09 '17 01:10 bmuenzenmeyer