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

Add option to keep single-line rules in CSS #1299

Open
Gennady-G opened this issue Dec 3, 2017 · 4 comments
Open

Add option to keep single-line rules in CSS #1299

Gennady-G opened this issue Dec 3, 2017 · 4 comments

Comments

@Gennady-G
Copy link

Gennady-G commented Dec 3, 2017

Description

Greetings!

if I have this
footer { padding: 1%; }

then after Shift+Alt+F I get

    footer {
        padding: 1%;
    }

Is there an option to kee 'one-line-rule' as it is?

Tried

"beautify.options": {"brace_style": "collapse,preserve-inline"}

but no luck

Settings

 {
    "window.zoomLevel": -1,
    "workbench.sideBar.location": "right",
    "files.autoSave": "afterDelay",
    "files.autoSaveDelay": 1000,
    "editor.cursorStyle": "underline",
    "liveServer.settings.donotShowInfoMsg": true,
    "liveServer.settings.donotVerifyTags": false,
    "html.format.contentUnformatted": "pre,code,textarea,li",  
}
@bitwiseman bitwiseman changed the title Keep single-row rules in CSS? Add preserve-inline rules in CSS Dec 4, 2017
@bitwiseman bitwiseman changed the title Add preserve-inline rules in CSS Add option to keep single-line rules in CSS Dec 4, 2017
@bitwiseman
Copy link
Member

This is related to #1124, but separate since it is asking only to preserve one-line rules.
Neither are present at this time.

@Gennady-G
Copy link
Author

Thank You for response @bitwiseman ! :)

@kleber-swf
Copy link

Maybe it should be an option like max_preserve_single_line_properties configured with the maximum number of properties to keep in a single line.

Formatted:

.fill {
	flex: 1 1 auto;
}

.item-name input {
	font-size: 1.5em;
}

.avatar {
	border-radius: 50%;
	margin-right: 10px
}

.avatar-32 {
	width: 32px;
	height: 32px
}

.avatar-64 {
	width: 64px;
	height: 64px
}

.avatar-100 {
	width: 100px;
	height: 100px
}

.avatar-128 {
	width: 128px;
	height: 128px
}

.details {
	padding: 2em;
}

.form-actions {
	direction: rtl;
}

Desired result:

.fill { flex: 1 1 auto; }
.item-name input { font-size: 1.5em; }

.avatar { border-radius: 50%; margin-right: 10px }
.avatar-32 { width: 32px; height: 32px }
.avatar-64 { width: 64px; height: 64px }
.avatar-100 { width: 100px; height: 100px }
.avatar-128 { width: 128px; height: 128px }

.details { padding: 2em; }
.form-actions { direction: rtl; }

@bitwiseman
Copy link
Member

This will require at least css tokenization to get it to work (#545). Once we have that this will be implemented the same way it is in the javascript side.

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

No branches or pull requests

3 participants