suffixedWith
For a String that represents a CSS class name, append the appropriate color mode suffix to it.
For example, "my-class".suffixedWith(ColorMode.DARK)
will return "my-class_dark"
.
Note: We use an underscore here as a separator instead of a hyphen, as Silk otherwise uses hyphens when generating class names, so this makes the separator stand out as something more orthogonal to the base name.
This also avoids ambiguity if you create a variant called "dark", as in MenuStyle.addVariant("dark")
, since that would generate a full style name of "menu-dark". In this case, when applying color mode suffixes to this, we will end up with "menu-dark_dark" and "menu-dark_light".