Skip to content

Commit 8e09fa1

Browse files
committed
fixes/closes issue #125 #118 where light skins of color can be added
1 parent 5317650 commit 8e09fa1

File tree

7 files changed

+26
-13
lines changed

7 files changed

+26
-13
lines changed

R/boxes.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ box <- function(..., title = NULL, footer = NULL, status = NULL,
284284
}
285285

286286
boxToolsTag <- NULL
287+
boxTools <- NULL
288+
287289
if (collapsible == TRUE || wrench == TRUE) {
288290
boxToolsTag <- TRUE
289291
} else {
@@ -311,17 +313,17 @@ box <- function(..., title = NULL, footer = NULL, status = NULL,
311313
)
312314
}
313315

314-
boxToolsTag <- div(class = "box-tools pull-right",
316+
boxTools <- div(class = "box-tools pull-right",
315317
collapseTag,
316318
wrenchTag
317319
)
318320
}
319321

320322
headerTag <- NULL
321-
if (!is.null(titleTag) || !is.null(boxToolsTag)) {
323+
if (!is.null(titleTag) || !is.null(boxTools)) {
322324
headerTag <- div(class = "box-header",
323325
titleTag,
324-
boxToolsTag
326+
boxTools
325327
)
326328
}
327329

R/dashboardPage.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
#' @param title A title to display in the browser's title bar. If no value is
99
#' provided, it will try to extract the title from the \code{dashboardHeader}.
1010
#' @param skin A color theme. One of \code{"blue"}, \code{"black"},
11-
#' \code{"purple"}, \code{"green"}, \code{"red"}, or \code{"yellow"}.
11+
#' \code{"purple"}, \code{"green"}, \code{"red"}, or \code{"yellow"}. Or light
12+
#' skin of each color, e.g. \code{"red-light"}
1213
#'
1314
#' @seealso \code{\link{dashboardHeader}}, \code{\link{dashboardSidebar}},
1415
#' \code{\link{dashboardBody}}.
16+
#'
1517
#' @examples
1618
#' ## Only run this example in interactive R sessions
1719
#' if (interactive()) {
@@ -29,7 +31,9 @@
2931
#' }
3032
#' @export
3133
dashboardPage <- function(header, sidebar, body, title = NULL,
32-
skin = c("blue", "black", "purple", "green", "red", "yellow")) {
34+
skin = c("blue", "blue-light", "black", "black-light", "purple",
35+
"purple-light", "green", "green-light", "red", "red-light", "yellow",
36+
"yellow-light")) {
3337

3438
tagAssert(header, type = "header", class = "main-header")
3539
tagAssert(sidebar, type = "aside", class = "main-sidebar")

R/utils.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ validateColor <- function(color) {
8383
#' @format NULL
8484
#'
8585
#' @keywords internal
86-
validColors <- c("red", "yellow", "aqua", "blue", "light-blue", "green",
86+
validColors <- c("red", "yellow", "aqua", "blue", "light-blue","blue-light",
87+
"green","black-light", "purple-light","green-light",
8788
"navy", "teal", "olive", "lime", "orange", "fuchsia",
88-
"purple", "maroon", "black")
89+
"purple", "maroon", "black", "red-light", "yellow-light")
8990

9091

9192
# Returns TRUE if a status is valid; throws error otherwise.
@@ -112,13 +113,14 @@ validateStatus <- function(status) {
112113
#' \item \code{info} Blue
113114
#' \item \code{warning} Orange
114115
#' \item \code{danger} Red
116+
#' \item \code{default} Grey
115117
#' }
116118
#'
117119
#' @usage NULL
118120
#' @format NULL
119121
#'
120122
#' @keywords internal
121-
validStatuses <- c("primary", "success", "info", "warning", "danger")
123+
validStatuses <- c("primary", "success", "info", "warning", "danger", "default")
122124

123125

124126
"%OR%" <- function(a, b) if (!is.null(a)) a else b

man/dashboardPage.Rd

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/renderMenu.Rd

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

man/validStatuses.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests-manual/bigDash.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ body <- dashboardBody(tabItems(
211211

212212
box(
213213
width = 4,
214+
status = "default",
214215
background = "light-blue",
215216
p("This is content. The background color is set to light-blue")
216217
)
@@ -306,6 +307,7 @@ server <- function(input, output) {
306307

307308
ui <- dashboardPage(header,
308309
sidebar,
309-
body)
310+
body,
311+
skin = "blue-light")
310312

311313
shinyApp(ui, server)

0 commit comments

Comments
 (0)