rstudio / rstudio/bslib

Utility function for watching scss files and pushing updates

Open
#140 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
SCSS
Stars
569
Forks
72
Avg merge
1d 2h
Merged PRs (30d)
5

Description

If someone has a Shiny application and wants to test out changes to a scss file with live changes, it would be useful to have a function that does something like this (I probably don't have all the details right, but this is the general idea):

r <- reactiveFileReader(500, session, "mytheme.scss", function(file) {
  file
})

observe({
  mytheme <- sass::sass_file(r())
  # If we had a reactive getCurrentTheme(), that would be good here
  theme <- bs_bundle(getCurrentTheme(), mytheme)
  session$setCurrentTheme(theme)
})

In the case where someone uses a Bootswatch theme, this would be really helpful, since the real-time themer in bootstraplib doesn't work well with the way variables are used in Bootswatch.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the existing real-time themer in bootstraplib and the reactiveFileReader, sass::sass_file, bs_bundle, getCurrentTheme(), and session$setCurrentTheme() entry points mentioned in the issue. Determine how a watched SCSS file could trigger recompilation and theme updates for Bootswatch variables, then add coverage for the intended live-update behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
bootstrap, r, sass, scss
Domain
frontend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.