41 CSSProperty(
const std::string &name,
const std::string &value);
47 const std::string&
getName()
const;
48 void setName(
const std::string &name);
51 void setValue(
const std::string &value);
66 void addProperty(
const std::string &name,
const std::string &value);
75 void parse(
const std::string &input);
79 std::vector<CSSProperty> _Properties;
85 CSSRule(
const std::string &selector);
97 std::string
serialize(
bool formatted =
false)
const;
100 std::string _Selector;
112 void parse(
const std::string &input);
120 const std::vector<CSSRule>&
getRules()
const;
122 std::string
serialize(
bool formatted =
false)
const;
152 const std::string &tag,
153 const std::vector<std::string> &classes,
154 const std::string &
id);
174 const std::string &cssClass,
175 const std::string &
id,
176 std::map<std::string,std::string> &props,
177 std::string &mediaRules,
178 std::set<std::string> &seenMediaBlocks)
const;
181 void _skipWhitespace(
const std::string &input,
size_t &pos)
const;
182 void _skipComment(
const std::string &input,
size_t &pos)
const;
183 std::vector<CSSRule> _Rules;
203 const std::map<std::string,std::string> &customProperties);
void addProperty(const std::string &name, const std::string &value)
void removeProperty(const std::string &name)
const std::vector< CSSProperty > & getProperties() const
std::string serialize() const
const CSSProperty * getProperty(const std::string &name) const
void parse(const std::string &input)
CSSDeclaration & operator=(const CSSDeclaration &decl)
void setName(const std::string &name)
const std::string & getName() const
void setValue(const std::string &value)
CSSProperty & operator=(const CSSProperty &prop)
const std::string & getValue() const
CSSDeclaration & getDeclaration()
std::string serialize(bool formatted=false) const
void setSelector(const std::string &selector)
CSSRule & operator=(const CSSRule &rule)
const std::string & getSelector() const
void parse(const std::string &input)
static bool approximateSelectorMatch(const std::string &selector, const std::string &tag, const std::vector< std::string > &classes, const std::string &id)
Conservative, NOT spec-complete selector match: selector (a single selector, or a comma-separated lis...
void collectApproximateMatches(const std::string &tag, const std::string &cssClass, const std::string &id, std::map< std::string, std::string > &props, std::string &mediaRules, std::set< std::string > &seenMediaBlocks) const
Runs every rule in this sheet through approximateSelectorMatch against the element identified by tag/...
const std::vector< CSSRule > & getRules() const
CSSStyleSheet & operator=(const CSSStyleSheet &sheet)
static CSSDeclaration parseInlineStyle(const std::string &style)
std::string serialize(bool formatted=false) const
const CSSRule * getRule(size_t index) const
void addRule(const CSSRule &rule)
void removeRule(size_t index)
size_t getRuleCount() const
Core namespace for the libhtmlpp HTML parsing and printing library.
std::string resolveCSSVariables(const std::string &value, const std::map< std::string, std::string > &customProperties)
Resolves every var(--name) / var(--name, fallback) reference in value using customProperties (custom-...