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

Format code #105

Open
HanzoDev1375 opened this issue Jan 17, 2025 · 5 comments
Open

Format code #105

HanzoDev1375 opened this issue Jan 17, 2025 · 5 comments
Assignees
Labels

Comments

@HanzoDev1375
Copy link

hello how to format code by in library??

@phax phax self-assigned this Jan 17, 2025
@phax phax added the question label Jan 17, 2025
@phax
Copy link
Owner

phax commented Jan 17, 2025

When you are using the CSSWriter to emit CSS code, you can provide CSSWriterSettings.
Via CSSWriterSettings.setOptimizedOutput (false) it will create formatted CSS code.

hth

@HanzoDev1375
Copy link
Author

@phax can you send demo java code?

@HanzoDev1375
Copy link
Author

HanzoDev1375 commented Jan 17, 2025

See e.g. https://github.com/phax/ph-css/blob/master/ph-css/src/test/java/com/helger/css/writer/CSSWriterTest.java#L148

Great, there is only one problem, when I try to sort the properties, it does not respond, sample code

h1{

color:red; 
} 

What I have in mind

h1{

color:  red; 
} 

@phax
Copy link
Owner

phax commented Jan 17, 2025

There is currently no way to customize the output with additional blanks or so - sorry

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

No branches or pull requests

2 participants