pattern-lab / styleguidekit-assets-default

The static assets for the default StyleguideKit for Pattern Lab. Contains styles and mark-up for Pattern Lab's front-end.
http://patternlab.io/
MIT License
35 stars 67 forks source link

Whitespace not preserved in code viewer #81

Open bmuenzenmeyer opened 6 years ago

bmuenzenmeyer commented 6 years ago

image

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

sghoweri commented 6 years ago

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.

bradfrost commented 6 years ago

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.

sghoweri commented 6 years ago

@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?

bmuenzenmeyer commented 6 years ago

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