Package: cssparser 0.1.1

mikefc

cssparser: Simple CSS Parser and Tools

Simple CSS parser and tools.

Authors:mikefc

cssparser_0.1.1.tar.gz
cssparser_0.1.1.zip(r-4.7)cssparser_0.1.1.zip(r-4.6)cssparser_0.1.1.zip(r-4.5)
cssparser_0.1.1.tgz(r-4.6-any)cssparser_0.1.1.tgz(r-4.5-any)
cssparser_0.1.1.tar.gz(r-4.7-any)cssparser_0.1.1.tar.gz(r-4.6-any)
cssparser_0.1.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
cssparser/json (API)
NEWS

# Install 'cssparser' in R:
install.packages('cssparser', repos = c('https://trevorld.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/coolbutuseless/cssparser/issues

Pkgdown/docs site:https://coolbutuseless.github.io

Datasets:

On CRAN:

Conda:

4.24 score 7 stars 8 scripts 12 exports 11 dependencies

Last updated from:a5a3765fd8. Checks:7 NOTE, 2 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-devel-x86_64NOTE216
source / vignettesOK150
linux-release-x86_64NOTE130
macos-release-arm64NOTE83
macos-oldrel-arm64NOTE84
windows-develNOTE125
windows-releaseNOTE99
windows-oldrelNOTE75
wasm-releaseOK110

Exports:css_applycss_apply_inlinecss_colour_to_hexcss_length_as_pixelscss_mergecss_pretty_printcss_string_as_css_lengthcss_string_as_pixelsread_cssread_inline_stylestyle_mergestyle_pretty_print

Dependencies:cligluelifecyclemagrittrR6rlangselectrstringistringrvctrsxml2

A Toy HTML Layout Engine in R

Rendered fromweb-page-render-frames.Rmdusingknitr::rmarkdownon May 25 2026.

Last update: 2021-09-29
Started: 2021-09-29

Another CSS parsing example

Rendered fromanother-example.Rmdusingknitr::rmarkdownon May 25 2026.

Last update: 2021-09-29
Started: 2021-09-29

Applying CSS to HTML

Rendered fromapply-css.Rmdusingknitr::rmarkdownon May 25 2026.

Last update: 2021-09-29
Started: 2021-09-29

Merging/Cascading CSS and Individual Styles

Rendered fromcss-merge.Rmdusingknitr::rmarkdownon May 25 2026.

Last update: 2021-09-29
Started: 2021-09-29

Reading/Parsing CSS

Rendered fromread-css.Rmdusingknitr::rmarkdownon May 25 2026.

Last update: 2021-09-29
Started: 2021-09-29

Readme and manuals

Help Manual

Help pageTopics
Multiply alpha channel by given valuealpha_mul
Set alpha channelalpha_set
A version of cat which has an indentation depthcat_indent
Create a named list (indexed by 'xpath') of the final computed style for each elementcss_apply
Apply the CSS to the given HTML, storing the result as inline 'style' tags on each elementcss_apply_inline
Convert CSS colour to standard hex colour (with alpha0)css_colour_to_hex
Create a new CSS length objectcss_length
Convert a CSS unit into a rough pixel measurementcss_length_as_pixels
Merge multiple stylesheets given in priority ordercss_merge
A CSS-aware version of nested 'modifyList()'css_merge_core
Pretty Printing of a CSS stylesheet (as produced by 'read_css()')css_pretty_print
Convert a string value into a numeric value with a 'unit' attribute (if a unit is present)css_string_as_css_length
Naively convert a CSS string value (e.g. '"1em"') into the number of pixels this represents.css_string_as_pixels
HTML4 user-agent csshtml4_user_agent_css
A minimal stream object (reminiscent of an R6 class)init_stream
Test if string is a single string with something in itis_char1
Break a string into labelled tokens based upon a set of patternslex
Parse a simple "at' rule from the stream at the current locationparse_at
Normalize a hex colour to an 8-char hexparse_colour_hex
Parse a hsl/hsla colour spec to a hex colourparse_colour_hsl_to_hex
Parse an rgb() or rgba() colour spec to a hex colourparse_colour_rgb_to_hex
Extract a declaration (i.e. a property/value pair) from token streamparse_declaration
Parse a 'nested at' rule from the stream at the current location.parse_nested_at
Parse a rule from the stream at the current locationparse_rule
Parse rules from the stream at the current locationparse_rules_from_stream
Extract selector from CSS tokens streamparse_selectors
s3 method fr printing a streamprint.stream
Convert CSS stylesheet from text or a file into a list objectread_css
Parse CSS declaration block (aka inline style) to a named list of CSS declarationsread_inline_style
Depth-first recursion into the HTML document node tree to accumulate/cascade stylesrecurse_node_tree
Calculate selector specificityselector_specificity
Split font shorthand property into a named list of verbose "font-*" propertiessplit_font_shorthand
Flatten a style to an inline stringstyle_flatten_to_inline
Merge multiple styles for a given element which are given in priority orderstyle_merge
Pretty Printing of a single style or declaration blockstyle_pretty_print
Trim the end off a stringtrim
Make a distinct, unlinked, independent copy of an xml nodexml_duplicate