Skip to content

Commit

Permalink
Merge pull request #14 from rstudio/shiny-1.6
Browse files Browse the repository at this point in the history
Additional rules for dark-mode themes to ensure sliderInput()'s text color is readable.
  • Loading branch information
cpsievert authored Jan 12, 2021
2 parents 588474a + 755de2d commit 73e4303
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 4 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
^\.Rproj\.user$
^.*\.sublime-.*$
^cran-comments.md$
^patches$
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: shinythemes
Title: Themes for Shiny
Version: 1.1.2
Version: 1.1.2.9000
Authors@R: c(
person("Winston", "Chang", role = c("aut", "cre"), email = "[email protected]"),
person(family = "RStudio", role = "cph"),
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
shinythemes 1.1.2.9000
=================

* Added additional CSS rules to make dark mode themes (e.g., darkly) work better with `shiny::sliderInput()` ([#14](https://github.com/rstudio/shinythemes/pull/14))

shinythemes 1.1.2
=================

Expand Down
3 changes: 2 additions & 1 deletion inst/shinythemes/css/cyborg.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion inst/shinythemes/css/darkly.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions inst/shinythemes/css/slate.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion inst/shinythemes/css/superhero.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions patches/001-readable-sliderInput.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
diff --git a/inst/shinythemes/css/cyborg.min.css b/inst/shinythemes/css/cyborg.min.css
index aac1c5a..d3faf47 100644
--- a/inst/shinythemes/css/cyborg.min.css
+++ b/inst/shinythemes/css/cyborg.min.css
@@ -10,7 +10,8 @@
font-weight: 700;
src: url(../fonts/Roboto_700.ttf) format('truetype');
}
-
+/* For compatibility with shiny::sliderInput() v1.6 & above */
+.irs-grid-pol{background:#fff !important;}.irs-grid-text{color:#fff !important;}.irs-min{color:#fff !important;}.irs-max{color:#fff !important;}
/*!
* bootswatch v3.3.7
* Homepage: http://bootswatch.com
diff --git a/inst/shinythemes/css/darkly.min.css b/inst/shinythemes/css/darkly.min.css
index 0082fec..745b66f 100644
--- a/inst/shinythemes/css/darkly.min.css
+++ b/inst/shinythemes/css/darkly.min.css
@@ -16,7 +16,8 @@
font-weight: 400;
src: url(../fonts/Lato_400italic.ttf) format('truetype');
}
-
+/* For compatibility with shiny::sliderInput() v1.6 & above */
+.irs-grid-pol{background:#fff !important;}.irs-grid-text{color:#fff !important;}.irs-min{color:#fff !important;}.irs-max{color:#fff !important;}
/*!
* bootswatch v3.3.7
* Homepage: http://bootswatch.com
diff --git a/inst/shinythemes/css/slate.min.css b/inst/shinythemes/css/slate.min.css
index 5eb3a4c..15a0918 100644
--- a/inst/shinythemes/css/slate.min.css
+++ b/inst/shinythemes/css/slate.min.css
@@ -1,3 +1,5 @@
+/* For compatibility with shiny::sliderInput() v1.6 & above */
+.irs-grid-pol{background:#c8c8c8 !important;}.irs-grid-text{color:#c8c8c8 !important;}.irs-min{color:#c8c8c8 !important;}.irs-max{color:#c8c8c8 !important;}
/*!
* bootswatch v3.3.7
* Homepage: http://bootswatch.com
diff --git a/inst/shinythemes/css/superhero.min.css b/inst/shinythemes/css/superhero.min.css
index f0deb84..ed12a30 100644
--- a/inst/shinythemes/css/superhero.min.css
+++ b/inst/shinythemes/css/superhero.min.css
@@ -16,7 +16,8 @@
font-weight: 700;
src: url(../fonts/Lato_700.ttf) format('truetype');
}
-
+/* For compatibility with shiny::sliderInput() v1.6 & above */
+.irs-grid-pol{background:#ebebeb !important;}.irs-grid-text{color:#ebebeb !important;}.irs-min{color:#ebebeb !important;}.irs-max{color:#ebebeb !important;}
/*!
* bootswatch v3.3.7
* Homepage: http://bootswatch.com

0 comments on commit 73e4303

Please sign in to comment.