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?
Related
I have website which is themable. the website has a theme editor which allows for dynamically change the website font. When the user selects a font, I want the font to be loaded dynamically from a css file.
The website is a static website using next export thus there's no next server in play.
when trying to load global css in runtime from the theme editor component i'm getting
Global CSS cannot be imported from files other than your Custom <App>. Please move all global CSS imports to pages/_app.js.
Read more: https://err.sh/next.js/css-global
But i cannot move the global css loading to the custom app file since i want to only load the fonts as needed (otherwise first load sucks).
using css modules doesn't seem like the right path since i need this to be applied globally.
The following SA question is similar, but the resolution there (moving css loading to custom app) is not valid in my case.
Next.js Global CSS cannot be imported from files other than your Custom <App>
What is the best way to achieve this?
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"),
...
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.
I'm new to QT and I'm trying to see if it's possible to load an external stylesheet from a global stylesheet just like in web dev, something like using the syntax "link rel="stylesheet".
Right now we have a global CSS sheet that is being called via C++ code with all the global elements and specific widget modifications, it has 2k lines of code and it's becoming unmanageable. I know I can keep the global file and start adding resource stylesheets or pure code put directly into QT Creator Style Sheet editor for each widget. However, the head of development really wants to separate that my code from his team, so avoid any changes in QT UI file as much as possible, so if something breaks he will know when it was me or him.
Is this possible? can I call a stylesheet from a stylesheet? I couldn't find this syntax in the QT guide.
my theme uses a dynamic css file 'custom-style.php' which is included through wp_enqueue_style();
This file includes some styles depending on the theme options (colors,fonts,...)
On some installation there is no access to this file. Trying to access the file via the source code gets a "500 Internal Server Error". Changing file permissions to 777 does not solve it.
How can I solve this? Is there any other possibility to create dynamic css files?
Alternatively I could write a function to include this css in the head of the html but this is not the way I want go. There are some lines of css and I don't like css in html output.
This problem is from the server and is related to the server configuration. You can put your css code in variable and use the file_put_contents function to put your css code into the style.css file.
Like the code below
<?php
$customColor = #fff;
$css_code = "body{ background:{$customColor}; }";
file_put_contents('style.css',''); //First we empty the file
file_put_contents('style.css',$css_code);//Transfer Css code to file
I used this method and it was a good solution