Open cpsievert opened 3 years ago
It appears utility classes are responsible for about 1/2 of Bootstrap CSS:
bs_size <- function(x) { bs <- bs_theme_dependencies(x)[[2]] f <- file.path(bs$src, bs$stylesheet) file.info(f)["size"] } bs_size(bs_theme()) #> bootstrap.min.css 227346 bs_theme() %>% bs_remove("_utilities") %>% bs_size() #> Error: The target selector was not found. #> Use "@extend .text-muted !optional" to avoid this error. #> on line 2 of inst/bs3compat/_help_text.scss #> >> @extend .form-text; @extend .text-muted; #> ------------------------------^ bs_theme() %>% bs_remove(c("bs3compat", "_utilities")) %>% bs_size() #> bootstrap.min.css 112914
More generally, seems we should favor Sass variables over @extend in bs3compat so it's easier to bs_remove() rules.
@extend
bs_remove()
Actually, bs3compat itself is pretty heavy 😬
bs_theme() %>% bs_remove("bs3compat") %>% bs_size() #> bootstrap.min.css 153618
It appears utility classes are responsible for about 1/2 of Bootstrap CSS:
More generally, seems we should favor Sass variables over
@extend
in bs3compat so it's easier tobs_remove()
rules.