toCss method
Converts the style to a CSS string.
Implementation
@override
String toCss() {
final buffer = StringBuffer();
final sortedKeys = _properties.keys.toList()..sort();
if (_minify) {
for (final property in sortedKeys) {
// No indentation, no spaces after colon/semicolon
buffer.write('$property:${_properties[property]};');
}
if (stylesheet != null) {
buffer.write(stylesheet!.toCss());
}
} else {
for (final property in sortedKeys) {
buffer.writeln(' $property: ${_properties[property]};');
}
if (stylesheet != null) {
buffer.write(stylesheet!.toCss());
}
}
return buffer.toString();
}