Merge pull request #1589 from umap-project/css-vars

chore: Use CSS variables
This commit is contained in:
David Larlet 2024-02-27 08:57:04 -05:00 committed by GitHub
commit 337c75151c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 45 additions and 30 deletions

View file

@ -31,7 +31,7 @@ hr {
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
border-color: #ddd;
border-color: var(--color-lightGray);
border-image: none;
border-style: solid;
border-width: 1px 0 0;
@ -223,7 +223,7 @@ button.flat,
padding: 7px 7px;
margin-bottom: 14px;
background: #393F3F;
color: #ddd;
color: var(--color-lightGray);
font-size: 10px;
border-radius: 0 2px;
}
@ -264,7 +264,7 @@ input + .error {
padding: 7px 7px;
margin-top: -14px;
margin-bottom: 14px;
background: #ddd;
background: var(--color-lightGray);
color: #fff;
background-color: #cc0000;
font-size: 11px;
@ -685,7 +685,7 @@ input[type=hidden].blur + [type="button"] {
position: absolute;
bottom: 0;
padding: 0 10px;
border-left: 1px solid #ddd;
border-left: 1px solid var(--color-lightGray);
overflow-x: auto;
z-index: 1010;
background-color: #fff;
@ -698,7 +698,7 @@ input[type=hidden].blur + [type="button"] {
}
#umap-ui-container.dark {
border-left: 1px solid #222;
background-color: #323737;
background-color: var(--color-darkGray);
color: #efefef;
}
#umap-ui-container.fullwidth {
@ -913,7 +913,7 @@ input:invalid {
color: #eeeeec;
padding: 0 7px;
line-height: 32px;
background-color: #323737;
background-color: var(--color-darkGray);
}
.dark .umap-close-link:hover {
background-color: #2e3436;

View file

@ -150,12 +150,12 @@ h2.section {
}
h2.tabs {
text-transform: uppercase;
color: #263B58;
color: var(--color-darkBlue);
text-align: left;
padding-top: 28px;
}
h2.tabs a {
color: #263B58;
color: var(--color-darkBlue);
text-decoration: underline;
text-decoration-thickness: 3px;
text-decoration-skip-ink: none;
@ -164,7 +164,7 @@ h2.tabs a {
}
h2.tabs a:not(.selected) {
font-weight: normal;
color: #263B58;
color: var(--color-darkBlue);
text-decoration: none;
margin-right: 0;
}
@ -205,8 +205,8 @@ body.content #umap-ui-container {
input[type="submit"],
.button {
background-color: #B9F5D2;
color: #263B58;
background-color: var(--button-primary-background);
color: var(--button-primary-color);
}
.button-primary {
font-weight: bold;
@ -215,8 +215,8 @@ input[type="submit"],
background-color: #35537c;
}
.wrapper .neutral, .wrapper input[type="submit"].neutral {
background-color: #ddd;
color: #323737;
background-color: var(--button-neutral-background);
color: var(--button-neutral-color);
}
.wrapper.somber {
background-color: #2E3641;
@ -399,7 +399,7 @@ ul.umap-autocomplete {
}
}
.table-header form input {
border: 2px solid #263B58;
border: 2px solid var(--color-darkBlue);
border-radius: 0;
padding: .5rem 1rem;
margin-bottom: 0;
@ -410,7 +410,7 @@ ul.umap-autocomplete {
width: 30ch;
}
.table-header form input[type="submit"] {
background-color: #263B58;
background-color: var(--color-darkBlue);
color: white;
font-weight: bold;
}
@ -419,8 +419,8 @@ ul.umap-autocomplete {
width: inherit;
display: inline;
padding: .5rem 1rem;
border: 2px solid #263B58;
color: #263B58;
border: 2px solid var(--color-darkBlue);
color: var(--color-darkBlue);
font-weight: bold;
background-color: initial;
margin-bottom: 0;
@ -443,7 +443,7 @@ ul.umap-autocomplete {
.table-wrapper table a,
.table-wrapper table thead tr th,
.table-wrapper table th[scope="row"] {
color: #263B58;
color: var(--color-darkBlue);
text-align: left;
padding-left: 2px;
}
@ -469,7 +469,7 @@ ul.umap-autocomplete {
.table-wrapper table input[type="submit"] {
display: inline;
background-color: transparent;
color: #263B58;
color: var(--color-darkBlue);
padding: 0;
width: inherit;
height: 1rem;
@ -527,7 +527,7 @@ dialog::backdrop {
padding: 1rem;
}
.pagination a {
color: #263B58;
color: var(--color-darkBlue);
text-decoration: underline;
}

View file

@ -13,7 +13,7 @@
* Same as leaflet background, to work around screen blincking
* between DOM is loaded and JS is read to render the map.
*/
background-color: #ddd;
background-color: var(--color-lightGray);
}
@ -293,7 +293,7 @@ ul.photon-autocomplete {
margin-top: 0;
vertical-align: top;
border-bottom: none;
background-color: #323737;
background-color: var(--color-darkGray);
border-right: 1px solid #eee;
background-repeat: no-repeat;
background-image: url('./img/24.svg');
@ -446,7 +446,7 @@ ul.photon-autocomplete {
max-width: 100vw;
padding: 40px 20px;
border: 1px solid #222;
background-color: #323737;
background-color: var(--color-darkGray);
color: #efefef;
font-size: 0.8em;
visibility: hidden;
@ -464,7 +464,7 @@ ul.photon-autocomplete {
background-position: -4px -4px;
background-repeat: no-repeat;
background-image: url('./img/16.svg');
background-color: #323737 !important;
background-color: var(--color-darkGray) !important;
vertical-align: middle;
text-indent: -9999px;
min-height: inherit;
@ -518,7 +518,7 @@ ul.photon-autocomplete {
color: #fff;
font-size: 1.2em;
border: none;
background-color: #323737;
background-color: var(--color-darkGray);
width: auto;
margin-bottom: 0;
}
@ -625,7 +625,7 @@ ul.photon-autocomplete {
left: 0;
right: 0;
height: 46px;
background-color: #323737;
background-color: var(--color-darkGray);
padding: 0 10px;
text-align: left;
line-height: 36px;
@ -728,7 +728,7 @@ ul.photon-autocomplete {
text-align: left;
line-height: 46px;
cursor: auto;
border-top: 1px solid #ddd;
border-top: 1px solid var(--color-lightGray);
opacity: 0.93;
z-index: 1000;
}
@ -884,10 +884,10 @@ ul.photon-autocomplete {
}
.leaflet-inplace-toolbar a {
background-image: url('./img/16-white.svg');
background-color: #323737!important;
background-color: var(--color-darkGray)!important;
}
.leaflet-toolbar-tip {
background-color: #323737;
background-color: var(--color-darkGray);
}
.leaflet-inplace-toolbar a:hover {
background-color: #353c3e!important;

View file

@ -36,7 +36,7 @@ footer .i18n_switch {
flex-direction: column;
}
.umap-nav a {
color: #263B58;
color: var(--color-darkBlue);
padding: .4rem;
}
.umap-nav a:hover {

View file

@ -62,6 +62,7 @@
<link rel="stylesheet" href="../vendors/locatecontrol/L.Control.Locate.min.css" />
<link rel="stylesheet" href="../vendors/iconlayers/iconLayers.css" />
<link rel="stylesheet" href="../../umap/vars.css" />
<link rel="stylesheet" href="../../umap/font.css" />
<link rel="stylesheet" href="../../umap/base.css" />
<link rel="stylesheet" href="../../umap/content.css" />

13
umap/static/umap/vars.css Normal file
View file

@ -0,0 +1,13 @@
:root {
/* Colors. */
--color-waterMint: #B9F5D2;
--color-darkBlue: #263B58;
--color-lightGray: #ddd;
--color-darkGray: #323737;
/* Buttons. */
--button-primary-background: var(--color-waterMint);
--button-primary-color: var(--color-darkBlue);
--button-neutral-background: var(--color-lightGray);
--button-neutral-color: var(--color-darkGray);
}

View file

@ -21,6 +21,7 @@
href="{% static 'umap/vendors/locatecontrol/L.Control.Locate.min.css' %}" />
<link rel="stylesheet"
href="{% static 'umap/vendors/iconlayers/iconLayers.css' %}" />
<link rel="stylesheet" href="{% static 'umap/vars.css' %}" />
<link rel="stylesheet" href="{% static 'umap/font.css' %}" />
<link rel="stylesheet" href="{% static 'umap/base.css' %}" />
<link rel="stylesheet" href="{% static 'umap/content.css' %}" />