inst/dev/sass.R

#' Build CSS
#' 
#' Build the sass
sass_build <- function(){
	has_sass <- requireNamespace("sass", quietly = TRUE)

	if(!has_sass){
		warning(
			"Requires `sass` package: `install.packages('sass')`\n", 
			"Skipping.",
			call. = FALSE
		)
		return()
	}

	output <- sass::sass(
		sass::sass_file(
			'scss/main.scss'
		),
		cache = NULL,
		options = sass::sass_options(
			output_style='compressed'
		),
		output = 'inst/assets/style.min.css'
	)
	invisible(output)
}

sass_build()

Try the leprechaun package in your browser

Any scripts or data that you put into this service are public.

leprechaun documentation built on Jan. 19, 2022, 5:08 p.m.