How to use a single css for multiple Shiny applications - css

I have a set of shiny applications stored in a folder 'apps'. Within the folder app we thus have 'app1', 'app2', etc. In each of those applications we have the default shiny files/folders, i.e. ui.R, server.R, global.R and the folder www.
Each www has its own stylesheet which is loaded into the application in the head tag of ui.R file:
tags$link(rel = "stylesheet", type = "text/css", href = "template.css")
However, there is some template css that should be applied to all the applications. Were can I best store this template css and use it in all the applications?
I currently have a copy of the template css in each of the www folders, which works, but it is obviously not ideal when making changes to this css.

Related

Blazor componen css is not loading when component is in folder

I have a blazor webassembly app. When I create a *.razor.css file for the component in one of the two default folders (Pages, Shared) everything works just fine. But I want to organize my code into subfolders like Pages/Components. I have created a new folder and test component in it Pages/Components/Test.razor. I have also added #using Project.Pages.Components to _Imports.razor. When I use the test component in my app it loads correctly. But I have an issue with CSS. I have created the CSS file Pages/Components/Test.razor.css. It looks like this file is ignored. When I look into Project.styles.css file which contains processed CSS of components from those two default folders it does not contains any CSS rules from the test file.
Is it possible to somehow configure blazor to include CSS from subfolders?

Showcase mode with shiny modules

I have a shiny application that uses shiny modules.
Each module lives in its own file in modules/ and is sourced in global.R.
I also have a DESCRIPTION file which puts the shiny app into the showcase mode when deployed.
The problem is, that only code for global.R, server.R, and ui.R is displayed, which is helpful but does not show the full picture (eg showing that mymodule_server("myid") is run in server.R is helpful but I want to have the reactive elements of the function shown and highlighted as its usual in the showcase mode).
Is this possible without dumping all modules in global.R?
Note that this is related to https://github.com/rstudio/shiny/issues/3453

How to edit the style of multiple Oracle Apex applications in a workspace

I want to edit the style of multiple applications inside my workspace with the less amout of effort. What I mean by "edit the style" is font size, background color, position, etc.
My idea was creating a CSS file at "Static Workspace Files" with the classes I want and applying them to the apex items needed. Applying this in a region for instance:
*.font16{
font-size: 16px;
}
The problem is: modal pages can't find the file, which is not a problem in nomral pages. I'm using the path '#WORKSPACE_IMAGES#styles.css' in the page "CSS > File URLs" setting.
I'm not sure if this is the right approach, maybe I should edit Themes or Templates, but since I'm pretty new to Apex I chose CSS for familiarity.
Application Express v20.1
That's what Static Workspace Files are meant for, files that can be used by multiple applications in the same workspace.
The easiest approach for this is to create a CSS, like what you've done.
You don't need to inlcude the file in every single page, which would become a maintenance nightmare eventually.
You can simply include the file at the application level:
In Share Components, go in the User Interface Attributes and include the file under Cascading Style Sheets.
I usually have one global.css file (as a static workspace file) for anything common to all my apps and one app.css per application (as a static application file) for things specific to the current application.
Note that application exports will contain the static application files, but they will not contain the static workspace files. You will need to export/import them yourself.
Did you try Theme Roller? Run the page, it is down in developer's toolbar.

R 3.5.1 shiny dashboard theme change

I want to connect external css file for R shiny dashboard. I am using R 3.5.1. I have downloaded cerulean theme as bootstrap.css in www directory. Using the code below
dashboardBody(
tags$head(
tags$link( rel="stylesheet",
type='text/css',
href = 'bootstrap.css'))
But cerulean theme is not appearing in shiny app.
Also I want to change the search input box displaying in 3D to 2D. Please have a look below:
New search input box should appear like below
I have no idea why the following works, but from experience: just renaming the .css file in your www folder and, ofcourse, in the .R file gets it working.
Your code seems fine.
Alternatively you may try includeCSS(). For this you should put your CSS in your app directory.
shinyUI(fluidPage(
includeCSS("styles.css"),
...

Call external (non-local, not in www) CSS files in Shiny

I would like to use CSS files not hosted on my Shiny server. Essentially, I'm at a university and would like to reference standard styles (and be seen to be using standard styles) without having to harvest all their styles and copy it to my server any time they update.
tags$link(rel = "stylesheet", type = "text/css", href = "custom.css") work great for custom.css within www, but I can't seem to reference an outside server.
I've also tried #import url('www.masterserver.edu/global.css') within my custom.css file to no avail.
Is there a way to do this?

Resources