mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-13 17:30:38 -07:00
Move color definitions out of response rate presenter and into _colors.scss
This commit is contained in:
parent
a785c69c44
commit
65ca0fd1ac
3 changed files with 7 additions and 6 deletions
|
|
@ -25,6 +25,11 @@ $growth: $gold;
|
||||||
$approval: $purple;
|
$approval: $purple;
|
||||||
$ideal: $purple;
|
$ideal: $purple;
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--color-purple: #{$purple};
|
||||||
|
--color-gold: #{$gold};
|
||||||
|
}
|
||||||
|
|
||||||
.color-red {
|
.color-red {
|
||||||
color: $red;
|
color: $red;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,7 @@ class ResponseRatePresenter
|
||||||
end
|
end
|
||||||
|
|
||||||
def color
|
def color
|
||||||
# Problem: the color (either $gold or $purple) is determined by the scss variable, but the
|
percentage > 75 ? "purple" : "gold"
|
||||||
# percentage is decided by the presenter. Therefore the class style must be generated
|
|
||||||
# within this file and not the scss file.
|
|
||||||
# TODO: Fix this.
|
|
||||||
percentage > 75 ? "#49416D" : "#FFC857"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
background: conic-gradient(<%= response_rate_presenter.color %> calc(<%= response_rate_presenter.percentage %>*1%),#0000 0);
|
background: conic-gradient(var(--color-<%= response_rate_presenter.color %>) calc(<%= response_rate_presenter.percentage %>*1%),#0000 0);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue