Style Plotly Express with CSS - css

I'm currently working on a DASH\Plotly app. I am using dash-bootstrap-components with a custom CSS file.
My current problem is, that my plots aren't styled from the CSS file. So they don't perfectly match with the rest of the theme. From what I found this functionality is not possible.
https://plotly.com/python/templates
Is there maybe a possibility to generate a custom plotly.io Template for the plots which is generated from the CSS file? So that the colors, fonts, fontsizes inside the plots match to the rest of the app.

Related

Generating templated HTML documents (unrelated CSS files) from ReactJS single page app

We have recently switched to a React SPA site. From the old site, we have some documents (invoices, quotes) that we generate as HTML files that we then print as PDFs. These templates are designed by a third party and have their own separate CSS files that have nothing to do with our React SPA's CSS. After the shift to React, I added some of the templates as React-friendly modules and converted their CSS to JSS. It worked but only partially as a lot of styles are overridden by the React SPA's CSS so the results are not consistent. We don't have the resources to redo all templates from scratch and this isn't something that we should be doing anyway - ideally, we want to be able to just load in the CSS that we get from the designer and only play around with the HTML/JSX (happy to use a tool to convert CSS to JSS but no custom editing). Is there a way to somehow ignore/unload all app CSS when loading a specific page, and only use a specific CSS/JSS file (in our case makeStyles), then bring it back to normal when another page is viewed?

Is there a way I can create (and update) a stylesheet using 2sxc and razor template?

DNN 9.3.2 / 2sxc 10.25.2
I have a DNN theme that I use for a certain type of subportal - I will have 8 subportals ultimately. Each subportal has the same layout, but they will have different colours in their respective theme. So I will have to create a stylesheet with the CSS rules and the colours for each theme. I know there is a couple of relatively simple ways I can do this:
Modifying the portal.css of each portal to override the theme or (simple but might be hard to maintain updates)
Building a custom theme for each portal (overkill)
Using SCSS to create a template with 8 different variable files (works fine but doesn't allow modifications by the Content Editors)
So, I'm curious if there's a more clever way through 2sxc that makes it easy for not only me to maintain, but also my portal's Content Editors.
I want to create 2sxc Content module with a few different fields for colour pickers that will allow me (and my content editors) to simply open up the 2sxc edit modal (on the homepage), fill out all the colour fields, and then a razor template will output the CSS template with the colours to override the theme styles on the DNN skin. I know I can do this with inline CSS but that would mean the module would have to appear on every page, and I'd also prefer to avoid inline CSS.
So my idea is that it would work like this:
Have a 2sxc Content module on a single page on each portal
Edit modal > the fields would be something like: primary colour (rgba), secondary colour (rgba), grey colour (rgba), etc
Once save is clicked, the template modifies a portal-level theme.css file which is loaded by the skin
Any changes to the module would result in a rewrite of the CSS file.
I could update the c# razor template to add, remove, or modify rules or transform the values of the input.
Is this possible or is it too complicated? Is there a better way of going about this?
So I've been away for a long time, I hope my answer will still help...
We have a very simple solution :). If you check out bootstrap instant template you'll see that we add various classes to the <body> tag.
https://github.com/2sic/dnn-theme-bootstrap4-instant/blob/master/controls/body-css-classes.ascx#L86-L91
That way we can just use normal CSS of the theme with rules based on portal-27 etc. to vary by portal.

How do the icons in TinyMCE work?

I can't seem to be able to find any information about this on the interwebs, but how do the icons in TinyMCE 4 work?
I know I can specify icons for buttons by name and specify custom icons for my custom buttons, but what if I wanted to take one of the standard icons, modify it in an image editing application and then save it as a custom icon. Where do I get the source image for that icon? Where can I see the full list of available icons and their names?
So, here is, possible, a partial answer to my own question or at least what I have managed to understand based on the poor documentation that currently exists for this aspect of TinyMCE 4.
Icons in TinyMCE 4.x use a custom IcoMoon font. The files for this font go in the skins//fonts directory.
If you download the TinyMCE Dev Package, you can find in js/tinymce/skins/lightgray/Icons.less all the icons that are available for that particular skin and you will be able to use those icons for your custom buttons (if you are using that skin).
You need to use the word between "-i-" and ":before". e.g. if the definition in Icons.less is:
.#{prefix}-i-alignleft:before
You can use the keyword alignleft as an icon for your custom button.
I haven't gotten as far as adding more icons to the default set, but I guess it would involve creating a new theme, hopefully inheriting from a parent theme, and defining your own Icons.less file and then process that LESS file to generate the appropriate CSS for your theme.

Free Download of Datatable css

I would like to change the css feel of my datatable. I am currently using jquerydatatables.css and jquery-ui.css. Is there any free download of datatable css?
Did you try checking the datatables website?
https://datatables.net/manual/styling/theme-creator
They provide support for several themes.
This online style builder will let you customise the colouring of the DataTables stylesheet to fit in seamlessly with your web-site or app. Simply select the colours you want for your table using the options below, and click the Create stylesheet button. The page will then reload and show your customised table below, with the CSS available to copy and paste for your site.
Here is the correct link-
Data tables applying your own css for changing the css of datatables.
You can provide it your own theme.
Just select the colors and
styling.
It will generate a CSS for your applied styling.
You can copy
in your css file.
You are good to go.
Hope this helps...

How to apply CSS to created pdf file in ASP.NET

I have generated a pdf file using third party now I want apply my own style to the content in pdf.
Can I insert an External CSS File into a generate PDF.
I have tried many ways but all is not working.
Thanks,
You cannot style an already generated PDF with CSS. It is not made out of selectable elements and there is no way to link the CSS to the PDF.
You will have to do the styling before the PDF is created. It's like trying to add more sugar to an already baked cake, there is no way to do it.

Resources