Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update shinydashboardPage to support latest light "skins". #259

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions R/dashboardPage.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
#' @param body A body created by \code{dashboardBody}.
#' @param title A title to display in the browser's title bar. If no value is
#' provided, it will try to extract the title from the \code{dashboardHeader}.
#' @param skin A color theme. One of \code{"blue"}, \code{"black"},
#' \code{"purple"}, \code{"green"}, \code{"red"}, or \code{"yellow"}.
#' @param skin A color theme. One of \code{"blue"}, \code{"blue-light"},
#' \code{"black"}, \code{"black-light"}, \code{"purple"}, \code{"purple-light"},
#' \code{"green"}, \code{"green-light"} , \code{"red"}, \code{"red-light"},
#' \code{"yellow"}, or \code{"yellow-light"}.
#'
#' @seealso \code{\link{dashboardHeader}}, \code{\link{dashboardSidebar}},
#' \code{\link{dashboardBody}}.
Expand All @@ -29,7 +31,8 @@
#' }
#' @export
dashboardPage <- function(header, sidebar, body, title = NULL,
skin = c("blue", "black", "purple", "green", "red", "yellow")) {
skin = c("blue", "blue-light","black","black-light", "purple","purple-light", "green","green-light",
"red","red-light", "yellow","yellow-light")) {

tagAssert(header, type = "header", class = "main-header")
tagAssert(sidebar, type = "aside", class = "main-sidebar")
Expand Down
53 changes: 50 additions & 3 deletions inst/shinydashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,56 @@ div.box-body .shiny-input-container {
width: auto;
}

/* Sidebar is dark, so make text light by default. */
.sidebar {
color: #fff;
/* When the sidebar is dark, make text light (#fff), and when it is light, make it dark (#2F4F4F). */

.skin-blue .sidebar {
color: #fff;
}

.skin-blue-light .sidebar {
color: #2F4F4F;

}
.skin-black .sidebar {
color: #fff;
}

.skin-black-light .sidebar {
color: #2F4F4F;

}

.skin-purple .sidebar {
color: #fff;
}

.skin-purple-light .sidebar {
color: #2F4F4F;

}
.skin-green .sidebar {
color: #fff;
}

.skin-green-light .sidebar {
color: #2F4F4F;

}
.skin-red .sidebar {
color: #fff;
}

.skin-green-red .sidebar {
color: #2F4F4F;

}
.skin-yellow .sidebar {
color: #fff;
}

.skin-yellow-light .sidebar {
color: #2F4F4F;

}
/* Slider min and max in sidebar. */
.sidebar .irs-min, .sidebar .irs-max {
Expand Down
11 changes: 7 additions & 4 deletions man/dashboardPage.Rd

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

4 changes: 3 additions & 1 deletion tests-manual/bigDash.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ header <- dashboardHeader(
)
)
sidebar <- dashboardSidebar(
headerPanel("Hello ") ,

sidebarUserPanel(
"User Name",
subtitle = a(href = "#", icon("circle", class = "text-success"), "Online"),
Expand Down Expand Up @@ -91,7 +93,7 @@ sidebar <- dashboardSidebar(
menuSubItem("Sub-item 2", tabName = "subitem2")
)
),
sidebarMenuOutput("menu")
sidebarMenuOutput("menu")
)

body <- dashboardBody(tabItems(
Expand Down
Loading