blob: a8293251ecedac49f48d481cdc5139d3d6fc5c87 [file] [log] [blame]
Dmitrii Filippov941ee632019-08-22 15:52:37 +00001= Gerrit Code Review - Plugin styles API
2
3This API is provided by link:pg-plugin-dev.html#plugin-styles[plugin.styles()]
4and provides a way to apply dynamically created styles to elements in a
5document.
6
7[[css]]
8== css
9`styles.css(rulesStr)`
10
11.Params
12- `*string* rulesStr` string with CSS styling declarations.
13
14Example:
15----
16const styleObject = plugin.styles().css('background: black; color: white;');
17...
18const className = styleObject.getClassName(element)
19...
20element.classList.add(className);
21...
22styleObject.apply(someOtherElement);
23----
24
25.Returns
26- Instance of link:pg-plugin-style-object.html[GrStyleObject].
27
28
29