简体   繁体   中英

How do I find my shiny app's existing css?

I am very new to css so perhaps I am asking the wrong question but when I use navbarPage am I adding css to my web app? When I add my own css for adding just some text and background color...

    <STYLE TYPE='text/css'>
/* CSS generated at csscreator.com */
BODY{background-color:#36454f; }
P{color:#999999; }
</STYLE>

...it removed the Navbar and my tabs are now just hyperlinks below my main title. Why is this?

ui.R

    library(shiny)

shinyUI(navbarPage("main title", theme = "www/my_css.css",
  tabPanel("Dashboard",
          plotOutput("plot1",       width = "1600px"),
          plotOutput("plot2",       width = "1600px"),
          plotOutput("plot3", width = "1600px"),
          actionButton("refresh", "Refresh now")),
  tabPanel("About" , p("test"))
    )  
  )

Is there a way to see the css that is created from the produced app?

How do I access a Shiny app's CSS?

This may not be the best way, but the way I do it (on Chrome Version 41.0.2272.101) is by right clicking the page and clicking the "View page source" option. Once the new tab opens up, you can see it's an HTML file corresponding to your Shiny app. The top of this HTML file contains references to CSS files used in the app within statements like:

<link href="shared/datepicker/css/datepicker.css" rel="stylesheet" />

Click the "shared/..." path and you'll be able to see the CSS file

Adding custom CSS

I'll be honest I haven't tried doing this, but this article may offer some insight.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM