csslib icon indicating copy to clipboard operation
csslib copied to clipboard

how to parse inline css style

Open dreamer-games opened this issue 4 years ago • 2 comments

It seems not working under the inline-style situation. I only need to parse a list of declarations, which is for the contents of a style attribute.

dreamer-games avatar Sep 29 '20 12:09 dreamer-games

+1

devjiangzhou avatar Nov 01 '20 05:11 devjiangzhou

This is what I do:

import 'package:csslib/parser.dart' as css;

final inlineStyle = 'color: red; background: blue;';
final styleSheet = css.parse('*{$inlineStyle}');

daohoangson avatar Nov 22 '20 16:11 daohoangson