From ef54cdc6dcb5c4cba960d71cb633280ca1544124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Luis=20Pereira?= Date: Fri, 9 Sep 2022 15:04:04 -0300 Subject: [PATCH] Move vars --- src/assets/css/main.css | 19 ++++++++ src/assets/css/tailwind.css | 52 ---------------------- src/assets/css/vars.css | 32 +++++++++++++ src/components/Map/utils/geojsonOptions.js | 17 +++++++ 4 files changed, 68 insertions(+), 52 deletions(-) create mode 100644 src/assets/css/vars.css diff --git a/src/assets/css/main.css b/src/assets/css/main.css index dcc497f..aef1796 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -1,5 +1,24 @@ @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,400;0,500;0,900;1,100;1,400&display=swap'); +@import '@/assets/css/vars.css'; @import '@/assets/css/tailwind.css'; @import 'leaflet/dist/leaflet.css'; @import '@/assets/css/leaflet.css'; @import '@/assets/css/webkit.css'; + +* { + box-sizing: content-box; +} + +body { + @apply + font-main + bg-base-background +} + +a { + @apply text-secondary-color; +} + +.dark { + color-scheme: dark; +} diff --git a/src/assets/css/tailwind.css b/src/assets/css/tailwind.css index f05bfaf..b5c61c9 100644 --- a/src/assets/css/tailwind.css +++ b/src/assets/css/tailwind.css @@ -1,55 +1,3 @@ @tailwind base; @tailwind components; @tailwind utilities; - -:root { - --color-primary: 0, 0, 0; - --color-primary-content: 255, 255, 255; - - --color-secondary: 14, 165, 233; - --color-secondary-content: 255, 255, 255; - - --color-base-foreground: 255, 255, 255; - --color-base-background: 245, 247, 251; - --color-base-muted: 226, 232, 240; - --color-base-border: 203, 213, 225; - --color-base-content: 0, 0, 0; - - --color-map-georeference-marker: 239, 68, 68; - --color-map-asserted: 249, 115, 22; -} - -.dark { - --color-primary: 14, 165, 233; - --color-primary-content: 255, 255, 255; - - --color-secondary: 14, 165, 233; - --color-secondary-content: 255, 255, 255; - - --color-base-background: 23,23,23; - --color-base-foreground: 38,38,38; - --color-base-muted: 30, 41, 59; - --color-base-border: 30, 41, 59; - --color-base-content: 255, 255, 255; -} - -* { - box-sizing: content-box; -} - -body { - @apply - font-main - bg-base-background - dark:text-slate-400; -} - -a { - @apply - text-secondary-color; - hover:text-gray-900; -} - -.dark { - color-scheme: dark; -} diff --git a/src/assets/css/vars.css b/src/assets/css/vars.css new file mode 100644 index 0000000..7ad4c8e --- /dev/null +++ b/src/assets/css/vars.css @@ -0,0 +1,32 @@ +:root { + --color-primary: 0, 0, 0; + --color-primary-content: 255, 255, 255; + + --color-secondary: 14, 165, 233; + --color-secondary-content: 255, 255, 255; + + --color-base-foreground: 255, 255, 255; + --color-base-background: 245, 247, 251; + --color-base-muted: 226, 232, 240; + --color-base-border: 203, 213, 225; + --color-base-content: 0, 0, 0; + + --color-map-georeference-marker: 239, 68, 68; + --color-map-asserted: 249, 115, 22; + --color-map-type-material: 51,136,255; + --color-map-collection-object: 51,136,255; +} + +.dark { + --color-primary: 14, 165, 233; + --color-primary-content: 255, 255, 255; + + --color-secondary: 14, 165, 233; + --color-secondary-content: 255, 255, 255; + + --color-base-background: 23,23,23; + --color-base-foreground: 38,38,38; + --color-base-muted: 30, 41, 59; + --color-base-border: 30, 41, 59; + --color-base-content: 255, 255, 255; +} \ No newline at end of file diff --git a/src/components/Map/utils/geojsonOptions.js b/src/components/Map/utils/geojsonOptions.js index dcfebd3..b23ca22 100644 --- a/src/components/Map/utils/geojsonOptions.js +++ b/src/components/Map/utils/geojsonOptions.js @@ -19,6 +19,7 @@ export default ({ }, style: (feature) => { + console.log(feature.properties?.base?.type) if (feature.properties?.base?.type === 'AssertedDistribution') { return { color: 'rgb(var(--color-map-asserted))', @@ -28,5 +29,21 @@ export default ({ fillOpacity: 0.5 } } + + if (feature.properties?.base?.type === 'TypeMaterial') { + return { + color: 'rgb(var(--color-map-type-material))', + weight: 1, + fillOpacity: 0.5 + } + } + + if (feature.properties?.base?.type === 'CollectionObject') { + return { + color: 'rgb(var(--color-map-collection-object))', + weight: 1, + fillOpacity: 0.5 + } + } } })