Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .standalone class to <body> when in standalone mode #6811

Merged
merged 2 commits into from Feb 5, 2019

Conversation

raphaelmerx
Copy link
Contributor

Closes #6810

Add a standalone class to the html <body> element when in standalone mode, so that one can add custom dashboard CSS that only applies in standalone mode.

@codecov-io
Copy link

codecov-io commented Feb 4, 2019

Codecov Report

Merging #6811 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6811   +/-   ##
=======================================
  Coverage   56.03%   56.03%           
=======================================
  Files         527      527           
  Lines       23286    23286           
  Branches     2788     2788           
=======================================
  Hits        13049    13049           
  Misses       9827     9827           
  Partials      410      410

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7b51ec...488e474. Read the comment docs.

@mistercrunch mistercrunch merged commit 6e91305 into apache:master Feb 5, 2019
@lilila
Copy link

lilila commented Mar 26, 2020

@raphaelmerx , Could you please show an example of how you use this.
When I use standalone=True I lose the label colors (even if they are in the URL) , do you know how to fix this?

@lilila
Copy link

lilila commented Apr 16, 2020

@raphaelmerx , could you please show an example of .standalone use in CSS.
Whenever I "explore" a chart from a dashboard I loos all CSS properties defined in the dashboard.
For instance, I am trying to increase the font size of dist_bar plot.
It works well in the Dashboard context but when I click on explore chart (standalone or not), the normal font size comes back. Do you have any suggestion for this? Thank you

@raphaelmerx
Copy link
Contributor Author

@lilila I have a superset URL for a standalone dashbaord that looks like https://example.com/superset/dashboard/10/?standalone=true. This URL is used in an iframe that is present on my site.
Then when i open that dashbaord URL (without the ?standalone=true) in a separate tab, and go to Edit dashboard > Edit CSS, some of my CSS only targets the dashboard in standalone mode e.g.

.standalone .dashboard-component-chart-holder {
    border: 1px solid;
}

@lilila
Copy link

lilila commented Apr 17, 2020

@raphaelmerx Thank you for your answer, so still is is a style sheet applied to the entire dashboard. I wish I find a way to keep the dashboard's style on a single chart when I go to the Explore Chart view. Basically I display iframed charts inside presentation (made with reveal.js) and I wish they look the same in the dashboard and in the presentation.
If you have any tips for this I would be glad.

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0 labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a way to write dashboard CSS that only applies in standalone mode
4 participants