Skip to content
This repository was archived by the owner on Apr 16, 2023. It is now read-only.

Commit ad52b52

Browse files
authored
Merge pull request #8 from nik01010/AddStatusHighlightColors
Add status highlight colors
2 parents bd0665f + 9882e38 commit ad52b52

File tree

6 files changed

+97
-32
lines changed

6 files changed

+97
-32
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: dashboardthemes
22
Type: Package
33
Title: Customise the appearance of Shiny dashboard applications using themes
4-
Version: 1.0.2
4+
Version: 1.0.3
55
Authors@R: person("Nik", "Lilovski", email = "nik.lilovski@outlook.com",
66
role = c("aut", "cre"))
77
Maintainer: Nik Lilovski <nik.lilovski@outlook.com>

NEWS.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
### dashboardthemes ----------------------------------------
1+
### dashboardthemes
2+
3+
### v1.0.3
4+
* Added option to change Primary/Success/Warning/Danger status highlight font colour.
5+
* Enables better visibility of header titles in boxes that use a specific status.
6+
* Updated all theme options with a status highlight font colour.
27

38
### v1.0.2
49
* Fixed small bug when viewing dashboards at smartphone screen resolution - first sidebar tab link was hidden.
@@ -17,21 +22,21 @@
1722
* First BETA release for Github.
1823

1924

20-
### v0.0.0.9003 --------------------------------------------
25+
### v0.0.0.9003
2126
* Added new theme.
2227
* Added support for datatable formatting.
2328

2429

25-
### v0.0.0.9002 --------------------------------------------
30+
### v0.0.0.9002
2631
* Fixed problem with textbox and drop-box font colour and drop-box menu background colour.
2732

2833

29-
### v0.0.0.9001 --------------------------------------------
34+
### v0.0.0.9001
3035
* Introduced four new arguments in shinyDashboardThemeDIY:
3136
sidebarPadding, sidebarMenuBackColor, sidebarMenuPadding, sidebarMenuBorderRadius.
3237
* Fixed problem with sidebar sub-tabs.
3338

3439

35-
### v0.0.0.9000 --------------------------------------------
40+
### v0.0.0.9000
3641
* ALPHA release.
3742
* Known issues: some application components have not been fully customised.

R/dashboardthemes.R

Lines changed: 63 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
###
55
### Contact: Nik Lilovski (nik.lilovski@outlook.com)
66
###
7-
### Last updated: 04 March 2018
7+
### Last updated: 15 February 2019
88
###
99
#' dashboardthemes: a package for custom themes in shinydashboard applications
1010
#'
@@ -340,6 +340,10 @@ shinyDashboardLogo <- function(theme){
340340
#'
341341
#' @param appFontFamily String. Application font.
342342
#' @param appFontColor String. Application font colour.
343+
#' @param primaryFontColor String. Primary status highlight font colour.
344+
#' @param successFontColor String. Success status highlight font colour.
345+
#' @param warningFontColor String. Warning status highlight font colour.
346+
#' @param dangerFontColor String. Danger status highlight font colour.
343347
#' @param bodyBackColor String. Main page background colour.
344348
#' @param logoBackColor String. Logo background colour.
345349
#' @param headerButtonBackColor String. Sidebar toggle button background colour.
@@ -419,6 +423,10 @@ shinyDashboardLogo <- function(theme){
419423
#' ### general
420424
#' appFontFamily = "Arial"
421425
#' ,appFontColor = "rgb(0,0,0)"
426+
#' ,primaryFontColor = "rgb(0,0,0)"
427+
#' ,successFontColor = "rgb(0,0,0)"
428+
#' ,warningFontColor = "rgb(0,0,0)"
429+
#' ,dangerFontColor = "rgb(0,0,0)"
422430
#' ,bodyBackColor = "rgb(248,248,248)"
423431
#'
424432
#' ### header
@@ -536,22 +544,24 @@ shinyDashboardLogo <- function(theme){
536544
#' )
537545
#' @seealso \code{\link{shinyDashboardThemes}, \link{shinyDashboardLogoDIY}, \link{cssGradientThreeColors}}
538546
#' @export
539-
shinyDashboardThemeDIY <- function(appFontFamily, appFontColor, logoBackColor, bodyBackColor, headerButtonBackColor, headerButtonIconColor,
540-
headerButtonBackColorHover, headerButtonIconColorHover, headerBackColor, headerBoxShadowColor,
541-
headerBoxShadowSize, sidebarBackColor, sidebarPadding, sidebarShadowRadius, sidebarShadowColor,
542-
sidebarMenuBackColor, sidebarMenuPadding, sidebarMenuBorderRadius, sidebarUserTextColor, sidebarSearchBackColor,
543-
sidebarSearchIconColor, sidebarSearchBorderColor, sidebarTabTextColor, sidebarTabTextSize, sidebarTabBorderStyle,
544-
sidebarTabBorderColor, sidebarTabBorderWidth, sidebarTabBackColorSelected, sidebarTabTextColorSelected,
545-
sidebarTabRadiusSelected, sidebarTabTextColorHover, sidebarTabBackColorHover, sidebarTabBorderStyleHover,
546-
sidebarTabBorderColorHover, sidebarTabBorderWidthHover, sidebarTabRadiusHover, boxBackColor, boxBorderRadius,
547-
boxShadowSize, boxShadowColor, boxTitleSize, boxDefaultColor, boxPrimaryColor, boxSuccessColor, boxWarningColor,
548-
boxDangerColor, tabBoxTabColor, tabBoxTabTextSize, tabBoxTabTextColor, tabBoxTabTextColorSelected, tabBoxBackColor,
549-
tabBoxHighlightColor, tabBoxBorderRadius, buttonBackColor, buttonTextColor, buttonBorderColor, buttonBorderRadius,
550-
buttonBackColorHover, buttonTextColorHover, buttonBorderColorHover, buttonHeight = 34, buttonPadding = "6px 12px",
551-
textboxBackColor, textboxBorderColor, textboxBorderRadius, textboxBackColorSelect, textboxBorderColorSelect,
552-
textboxHeight = 34, textboxPadding = "6px 12px", tableBackColor, tableBorderColor,
553-
tableBorderTopSize, tableBorderRowSize) {
554-
547+
shinyDashboardThemeDIY <- function(
548+
appFontFamily, appFontColor, logoBackColor, bodyBackColor, headerButtonBackColor, headerButtonIconColor,
549+
headerButtonBackColorHover, headerButtonIconColorHover, headerBackColor, headerBoxShadowColor,
550+
headerBoxShadowSize, sidebarBackColor, sidebarPadding, sidebarShadowRadius, sidebarShadowColor,
551+
sidebarMenuBackColor, sidebarMenuPadding, sidebarMenuBorderRadius, sidebarUserTextColor, sidebarSearchBackColor,
552+
sidebarSearchIconColor, sidebarSearchBorderColor, sidebarTabTextColor, sidebarTabTextSize, sidebarTabBorderStyle,
553+
sidebarTabBorderColor, sidebarTabBorderWidth, sidebarTabBackColorSelected, sidebarTabTextColorSelected,
554+
sidebarTabRadiusSelected, sidebarTabTextColorHover, sidebarTabBackColorHover, sidebarTabBorderStyleHover,
555+
sidebarTabBorderColorHover, sidebarTabBorderWidthHover, sidebarTabRadiusHover, boxBackColor, boxBorderRadius,
556+
boxShadowSize, boxShadowColor, boxTitleSize, boxDefaultColor, boxPrimaryColor, boxSuccessColor, boxWarningColor,
557+
boxDangerColor, tabBoxTabColor, tabBoxTabTextSize, tabBoxTabTextColor, tabBoxTabTextColorSelected, tabBoxBackColor,
558+
tabBoxHighlightColor, tabBoxBorderRadius, buttonBackColor, buttonTextColor, buttonBorderColor, buttonBorderRadius,
559+
buttonBackColorHover, buttonTextColorHover, buttonBorderColorHover, buttonHeight = 34, buttonPadding = "6px 12px",
560+
textboxBackColor, textboxBorderColor, textboxBorderRadius, textboxBackColorSelect, textboxBorderColorSelect,
561+
textboxHeight = 34, textboxPadding = "6px 12px", tableBackColor, tableBorderColor,
562+
tableBorderTopSize, tableBorderRowSize, primaryFontColor = "auto", successFontColor = "auto",
563+
warningFontColor = "auto", dangerFontColor = "auto"
564+
) {
555565

556566
htmltools::tags$head(
557567

@@ -810,8 +820,8 @@ shinyDashboardThemeDIY <- function(appFontFamily, appFontColor, logoBackColor, b
810820
}
811821
812822
/* box: primary color */
813-
.box.box-solid.box-primary>.box-header, .box.box-primary>.box-header {
814-
color: ', appFontColor, ';
823+
.box.box-solid.box-primary>.box-header h3, .box.box-primary>.box-header h3 {
824+
color: ', primaryFontColor, ';
815825
}
816826
.box.box-solid.box-primary>.box-header {
817827
background: ', boxPrimaryColor, ';
@@ -826,8 +836,8 @@ shinyDashboardThemeDIY <- function(appFontFamily, appFontColor, logoBackColor, b
826836
}
827837
828838
/* box: success color */
829-
.box.box-solid.box-success>.box-header, .box.box-success>.box-header {
830-
color: ', appFontColor, ';
839+
.box.box-solid.box-success>.box-header h3, .box.box-success>.box-header h3 {
840+
color: ', successFontColor, ';
831841
}
832842
.box.box-solid.box-success>.box-header {
833843
background: ', boxSuccessColor, ';
@@ -842,8 +852,8 @@ shinyDashboardThemeDIY <- function(appFontFamily, appFontColor, logoBackColor, b
842852
}
843853
844854
/* box: warning color */
845-
.box.box-solid.box-warning>.box-header, .box.box-warning>.box-header {
846-
color: ', appFontColor, ';
855+
.box.box-solid.box-warning>.box-header h3, .box.box-warning>.box-header h3 {
856+
color: ', warningFontColor, ';
847857
}
848858
.box.box-solid.box-warning>.box-header {
849859
background: ', boxWarningColor, ';
@@ -858,8 +868,8 @@ shinyDashboardThemeDIY <- function(appFontFamily, appFontColor, logoBackColor, b
858868
}
859869
860870
/* box: danger color */
861-
.box.box-solid.box-danger>.box-header, .box.box-danger>.box-header {
862-
color: ', appFontColor, ';
871+
.box.box-solid.box-danger>.box-header h3, .box.box-danger>.box-header h3 {
872+
color: ', dangerFontColor, ';
863873
}
864874
.box.box-solid.box-danger>.box-header {
865875
background: ', boxDangerColor, ';
@@ -1276,6 +1286,10 @@ theme_blue_gradient <- shinyDashboardThemeDIY(
12761286
### general
12771287
appFontFamily = "Arial"
12781288
,appFontColor = "rgb(0,0,0)"
1289+
,primaryFontColor = "rgb(0,0,0)"
1290+
,successFontColor = "rgb(0,0,0)"
1291+
,warningFontColor = "rgb(0,0,0)"
1292+
,dangerFontColor = "rgb(0,0,0)"
12791293
,bodyBackColor = "rgb(248,248,248)"
12801294

12811295
### header
@@ -1400,6 +1414,10 @@ theme_boe_website <- shinyDashboardThemeDIY(
14001414
### general
14011415
appFontFamily = "Arial"
14021416
,appFontColor = "rgb(42,102,98)"
1417+
,primaryFontColor = "rgb(0,0,0)"
1418+
,successFontColor = "rgb(0,0,0)"
1419+
,warningFontColor = "rgb(0,0,0)"
1420+
,dangerFontColor = "rgb(0,0,0)"
14031421
,bodyBackColor = "rgb(255,255,254)"
14041422

14051423
### header
@@ -1500,6 +1518,10 @@ theme_grey_light <- shinyDashboardThemeDIY(
15001518
### general
15011519
appFontFamily = "Arial"
15021520
,appFontColor = "rgb(45,45,45)"
1521+
,primaryFontColor = "rgb(15,15,15)"
1522+
,successFontColor = "rgb(15,15,15)"
1523+
,warningFontColor = "rgb(15,15,15)"
1524+
,dangerFontColor = "rgb(15,15,15)"
15031525
,bodyBackColor = "rgb(240,240,240)"
15041526

15051527
### header
@@ -1599,6 +1621,10 @@ theme_grey_dark <- shinyDashboardThemeDIY(
15991621
### general
16001622
appFontFamily = "Arial"
16011623
,appFontColor = "rgb(205,205,205)"
1624+
,primaryFontColor = "rgb(255,255,255)"
1625+
,successFontColor = "rgb(255,255,255)"
1626+
,warningFontColor = "rgb(255,255,255)"
1627+
,dangerFontColor = "rgb(255,255,255)"
16021628
,bodyBackColor = "rgb(45,55,65)"
16031629

16041630
### header
@@ -1699,6 +1725,10 @@ theme_onenote <- shinyDashboardThemeDIY(
16991725
### general
17001726
appFontFamily = "Arial"
17011727
,appFontColor = "rgb(0,0,0)"
1728+
,primaryFontColor = "rgb(0,0,0)"
1729+
,successFontColor = "rgb(0,0,0)"
1730+
,warningFontColor = "rgb(0,0,0)"
1731+
,dangerFontColor = "rgb(0,0,0)"
17021732
,bodyBackColor = "rgb(255,255,255)"
17031733

17041734
### header
@@ -1823,6 +1853,10 @@ theme_poor_mans_flatly <- shinyDashboardThemeDIY(
18231853
### general
18241854
appFontFamily = "Arial"
18251855
,appFontColor = "rgb(33,37,41)"
1856+
,primaryFontColor = "rgb(245,245,245)"
1857+
,successFontColor = "rgb(33,37,41)"
1858+
,warningFontColor = "rgb(33,37,41)"
1859+
,dangerFontColor = "rgb(33,37,41)"
18261860
,bodyBackColor = "rgb(255,255,255)"
18271861

18281862
### header
@@ -1923,6 +1957,10 @@ theme_purple_gradient <- shinyDashboardThemeDIY(
19231957
### general
19241958
appFontFamily = "Arial"
19251959
,appFontColor = "rgb(128,177,221)"
1960+
,primaryFontColor = "rgb(255,255,255)"
1961+
,successFontColor = "rgb(255,255,255)"
1962+
,warningFontColor = "rgb(255,255,255)"
1963+
,dangerFontColor = "rgb(255,255,255)"
19261964
,bodyBackColor = cssGradientThreeColors(
19271965
direction = "down"
19281966
,colorStart = "rgb(49,56,107)"

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ Example of creating a custom theme object. Each parameter can be changed as requ
121121
### general
122122
appFontFamily = "Arial"
123123
,appFontColor = "rgb(0,0,0)"
124+
,primaryFontColor = "rgb(0,0,0)"
125+
,successFontColor = "rgb(0,0,0)"
126+
,warningFontColor = "rgb(0,0,0)"
127+
,dangerFontColor = "rgb(0,0,0)"
124128
,bodyBackColor = "rgb(248,248,248)"
125129

126130
### header

man/shinyDashboardThemeDIY.Rd

Lines changed: 15 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/using_dashboardthemes.Rmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ Example of creating a custom theme object. Each parameter can be changed as requ
110110
### general
111111
appFontFamily = "Arial"
112112
,appFontColor = "rgb(0,0,0)"
113+
,primaryFontColor = "rgb(0,0,0)"
114+
,successFontColor = "rgb(0,0,0)"
115+
,warningFontColor = "rgb(0,0,0)"
116+
,dangerFontColor = "rgb(0,0,0)"
113117
,bodyBackColor = "rgb(248,248,248)"
114118
115119
### header

0 commit comments

Comments
 (0)