addRule

Inserts a new rule with the given ruleText in a stylesheet with given styleSheetId, at the position specified by location.

Official doc

Note: this function uses an input class, and constructing this class manually may lead to incompatibilities if the class's constructor arguments change in the future. For maximum compatibility, it is advised to use the overload of this function that directly takes the mandatory parameters as arguments, and the optional ones from a configuration lambda.


inline suspend fun addRule(styleSheetId: StyleSheetId, ruleText: String, location: SourceRange, optionalArgs: AddRuleRequest.Builder.() -> Unit = {}): AddRuleResponse

Inserts a new rule with the given ruleText in a stylesheet with given styleSheetId, at the position specified by location.

Official doc

Parameters

styleSheetId

The css style sheet identifier where a new rule should be inserted.

ruleText

The text of a new rule.

location

Text position of a new rule in the target style sheet.