Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Eclipse Web Tools Platform Project (WTP) » Autoformat breaks CSS variables(Source > Format breaks CSS variables)
Autoformat breaks CSS variables [message #1842448] Sat, 19 June 2021 20:29
Jack Kirby is currently offline Jack KirbyFriend
Messages: 2
Registered: June 2021
Junior Member
I am working a webpage with some CSS variables, but when I press Ctrl + Shift + F (same as Source > Format) it breaks my CSS variables. For example, this is my style element before a format:

<style>
:root { 
	--btn-width: 48%;
}

.apply-background {
	background-image: url([[@{/brand-icons/banner.png}]]);
	background-repeat: no-repeat;
	background-position: center;
	background-size: cover;
}

.card {
	width: 22%;
	background-color: lightsteelblue;
}

.btn {
	width: var(--btn-width);
}

.btn-right {
	float: right;
}
</style>


And this is after a format:

:root { -
	-btn-width: 48%;
}

.apply-background {
	background-image: url([[@{/brand-icons/banner.png}]]);
	background-repeat: no-repeat;
	background-position: center;
	background-size: cover;
}

.card {
	width: 22%;
	background-color: lightsteelblue;
}

.btn {
	width: var(- -btn-width);
}

.btn-right {
	float: right;
}


You can see that the autoformat is creating a newline between the two hyphens that precede CSS variables, which is breaking the code.

Is there a fix for this?
Previous Topic:How do I change the javascript version
Next Topic:Application Android whit Server GlassFish
Goto Forum:
  


Current Time: Tue Apr 23 14:14:29 GMT 2024

Powered by FUDForum. Page generated in 0.02550 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top