This is a repo of css helpers to make Superset dashboard styles more consistent.
CSS helpers can be found in app/css
and are also accessible via github pages for import.
The helpers are built with Stylus, a CSS preprocessor, and then compiled to CSS via gulp.
To set up the repo:
npm i
gulp
- this will listen for changes to your .styl
files and compile changes.In app/styl
you will find the stylus files where you can make edits. They will automatically be compiled into CSS via Gulp.
There are 2 templates that have been created for styling Superset dashboards in this repo:
* In Superset, this can be activated by picking the Authoring Dashboard CSS - no button wipeout
option
In this repo, you can adjust this template by editing dashboard--master--no-button-wipeout.styl
For production, all styles and hide chart controls: This provides all the dashboard styling and also hides the chart controls and superset header.
Authoring Dashboard CSS - with button wipeout
optiondashboard--master.styl
and its associated filesYou can add the button wipeout by calling this css in superset:
@import url('https://massgov.github.io/dashboard-style-helpers/app/css/dashboard--wipeout-buttons.css')
Here is how you create a text slice within Superset.
html
under the code settings<style type="text/css" scoped>
@import url('https://massgov.github.io/dashboard-style-helpers/app/css/dashboard--type-styles.css');
</style>
text-wrapper
which can be applied to a div to constrains the width of a text container so it is more readable. <h1>I am a H1. I should be used for the dashboard title </h1>
<h2> I am a H2. I should be used to start a section of a dashboard. </h2>
<div class="text-wrapper">
<h3> I am a H3. You should use me for subheadings within a section.</h3>
<p>I am a p tag. You can use me for any of your descriptions. You can also <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a">add links with an a tag</a>, or <i>italicize text</i> with <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/i">the i tag</a>, or <b>bold text</b> with <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b">the b tag.</a></p>
<p>Create new paragraphs with a new set of tags. Here is an example of an unordered list built with <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul"> the ul tag</a>:</p>
<ul>
<li>This list is great.</li>
<li>I am also great.</li>
</ul>
<p>You can also do ordered lists with the <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol"> the ol tag</a>:</p>
<ol>
<li>This list is great.</li>
<li>I am also great.</li>
</ol>