Skip to content

Commit

Permalink
use an icon for warning sign and replace clipboard with double squares (
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromedockes authored Sep 6, 2024
1 parent 8812105 commit 696ae77
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 11 deletions.
1 change: 0 additions & 1 deletion examples/00_getting_started.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Getting Started
===============
This guide showcases the features of ``skrub``, an open-source package that aims at
bridging the gap between tabular data sources and machine-learning models.
Expand Down
5 changes: 4 additions & 1 deletion skrub/_reporting/_data/templates/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
--mediumg: #d0d0d0;
--lightg: #f0f0f0;

--darkred: #a32929;
--red: #dd0000;

--fontStack-monospace: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, "DejaVu Sans Mono", Liberation Mono, monospace;
}

Expand Down Expand Up @@ -248,7 +251,7 @@ dd {
}

.critical {
color: red;
color: var(--red);
}

/* Misc tweaks */
Expand Down
2 changes: 1 addition & 1 deletion skrub/_reporting/_data/templates/buttons.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
type="button"
onclick="copyButtonClick(event)"
data-target-id="{{ target }}">
{% include "icons/clipboard.svg" %}
{% include "icons/copy.svg" %}
{% include "icons/check-lg.svg" %}
<div class="copied-message">Copied!</div>
</button>
Expand Down
3 changes: 3 additions & 0 deletions skrub/_reporting/_data/templates/icons/copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 19 additions & 7 deletions skrub/_reporting/_data/templates/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

.tab {
display: flex;
align-items: center;
column-gap: var(--micro);
border: 1px solid transparent;
border-bottom: none;
Expand All @@ -41,29 +42,40 @@
padding-bottom: var(--tiny);
font-size: var(--small);
background-color: transparent;
opacity: 0.8;
--color-muted: var(--darkg);
--color-default: inherit;
color: var(--color-muted);
}

.tab:hover {
opacity: 1.0;
color: var(--color-default);
}

.tab[data-is-selected] {
border-color: var(--darkg);
background-color: white;
opacity: 1.0;
color: var(--color-default);
}

/* When a tab contains critical content we highlight the corresponding button so */
/* the user is more likely to click on it. ATM this is just used for the */
/* associations tab when some columns are very strongly associated. */

.tab-list .tab[data-has-warning] {
color: red;
.tab-list .tab .warning-sign {
display: none;
width: 1em;
height: 1em;
margin: 1px;
}

.tab-list .tab[data-has-warning] .warning-sign {
display: inline-block;
}

.tab-list .tab[data-has-warning]::before {
content: "⚠️ ";
.tab-list .tab[data-has-warning] {
--color-muted: var(--darkred);
--color-default: var(--red);

}

/* The panels (the main content) */
Expand Down
6 changes: 5 additions & 1 deletion skrub/_reporting/_data/templates/tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
<button type="button" data-target-panel-id="column-associations-panel"
data-role="tab" class="tab" {% if associations_warning %}
data-has-warning {% endif %} data-test="associations-tab"
title="{{ associations_title }}">Associations</button>
title="{{ associations_title }}">
<div class="warning-sign">
{% include "icons/exclamation-triangle.svg" %}
</div>
Associations</button>
</div>
</div>
{% include "column-filter.html" %}
Expand Down

0 comments on commit 696ae77

Please sign in to comment.