I encountered the issue with Dart compiler errors ...
# suitecommerce
k
I encountered the issue with Dart compiler errors related to the following statement.
Copy code
@extend .button-secondary:hover;
The Sass compiler error suggested the following change:
Copy code
@extend .button-secondary, :hover;
What is happening in the compiled CSS when you specify
@extends :hover;
? I can not find any documentation about this when you extend a pseudo-class.
c
I just don't extend pseudo classes.
Copy code
&:hover {
		color: $sc-button-secondary-hover-text-color;
		background: $sc-button-secondary-hover-background-color;
		border-color: $sc-button-secondary-hover-border-color;
		text-decoration: none;
	}
k
hi @Chris, I dug deeper into this today and talked with another developer. I also downloaded the compiled CSS file and fetched the latest SuiteCommerce Base Theme to find out what the NetSuite developers implemented to fix this issue. I compared the 2022.2 version and 2023.2 versions of the base theme, and the developers implemented the Sass compiler suggestion. SuiteCommerce Base Theme 2023.2.3
Copy code
.open .split-button-toggle {
	@extend .button-secondary, :hover;

	i.split-button-toggle-icon {
		color: $sc-neutral-shade-0;
	}
}
I don’t think is the correct. I don’t think the original implementation intended to extend the .button-secondary styles, just the hover styles. I think what you did is correct and is what the original developers intended. The developer and I came up with a different approach which I think is the same thing, but I haven’t tested it:
Copy code
%placeholder:hover {
	color: $sc-button-secondary-hover-text-color;
	background: $sc-button-secondary-hover-background-color;
	border-color: $sc-button-secondary-hover-border-color;
	text-decoration: none;
}

.open .split-button-toggle {
@extends %placeholder;
}
When I looked at the compiled CSS file, the
@extend .button-secondary, :hover;
added a large chunk of css that was associated with
.open .split-button-toggle
that I think was created due to the
@extends :hover;
c
When code reuse makes original intent undecipherable, it makes copy/paste the sane option. There are too many tasks in the day to make everything super-elegant.
k
I agree. Figuring this out was a huge suck of time and there was very little discussion on Google about extending pseudo-classes.
💯 1