Skip to content

Feature request: parse css to/from text #1

@rbirdpersons

Description

@rbirdpersons

Would you consider adding functions to parse css to/from character strings rather than text files?

e.g.

parse_css <- function(css_text) {
  css_tbl <- css_text %>% gsub("/[*].*?[*]/", "", .) %>%
    gsub("//.?\\n", "\\n", .) %>% css:::tokenize_css()
}


create_css <- function(css_tbl) {
  css_text <- css_tbl %>%
    mutate(text = glue("{property}: {value} ; ")) %>%
    group_by(rule) %>%
    summarise(text = paste(paste("  ", text), collapse = "\n")) %>%
    mutate(glue("{rule} {{ \n{text} \n }}\n")) %>%
    pull()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions