调整带有徽标的shinydashboard标题的高度

w51jfk4q  于 2023-05-11  发布在  其他
关注(0)|答案(1)|浏览(111)

我有这样的代码来制作我的 Jmeter 板:

library(shinydashboard)
library(shiny)
library(fresh)
mytheme <- create_theme(
  adminlte_color(
    light_blue = "#004e70"
  ),
  adminlte_sidebar(
    width = "400px",
    dark_bg = "#3c3b3b",
    dark_hover_bg = "#004e70",
    dark_color = "white"
  )
)

Header <- dashboardHeader(
  title = "Labor Market Discrimination in Ecuador",
  titleWidth = 450,
  tags$li(a(img(src = "BID_Blanco.png",
                title = "IDB Logo", height = "60px"),
            tags$style(".sidebar-toggle {height: 70px; padding-top:10px; padding-botton:10px;")),
          class = "dropdown")
)

Tabs <- dashboardSidebar(
  tags$style(".left-side, .main-sidebar {padding-top: 70px}"),
  sidebarMenu(
    menuItem("General", tabName = "general"),
    menuItem("Trial", tabName = "by_trial"),
    menuItem("Sex", tabName = "by_ss")
  )
)

Body <- dashboardBody(
  use_theme(mytheme),
  tabItems(
    tabItem(tabName = "general"),
    tabItem(tabName = "by_trial"),
    tabItem(tabName = "by_ss")
  )
)

ui <- dashboardPage(
  Header, 
  Tabs,
  Body
)

shinyApp(ui, server)

这将产生以下结果:

我能做些什么让标题变高(哪里写着“厄瓜多尔劳动力市场歧视”)?就像标志所在的蓝色条一样高
去掉制表符开始的空白(就在“general”上面)这是我的第一个shinydashboard,所以我有点迷路了。

oknwwptz

oknwwptz1#

您需要为.logo范围指定height(确保以足够的具体性来寻址<span>,以确保您的规则最终适用):

Body <- dashboardBody(
  use_theme(mytheme),
  tags$head(
    tags$style("
       .left-side, .main-sidebar {
          padding-top: 70px;
       }
       .skin-blue .main-header .logo {
          height: 70px; 
          display: inline-flex;
          align-items: center;
       }")
     ),
  tabItems(
    tabItem(tabName = "general"),
    tabItem(tabName = "by_trial"),
    tabItem(tabName = "by_ss")
  )
)

相关问题