Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement handling for theming #63

Merged
merged 5 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions antd.theme.js

This file was deleted.

11 changes: 0 additions & 11 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,5 @@ module.exports = {
],
'@babel/preset-typescript',
'@babel/preset-react'
],
plugins: [
[
'import',
{
libraryName: 'antd',
libraryDirectory: 'lib',
style: true
},
'import-antd'
]
]
};
19 changes: 0 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
"@typescript-eslint/parser": "^5.26.0",
"babel-jest": "^28.1.0",
"babel-loader": "^8.2.5",
"babel-plugin-import": "^1.13.5",
KaiVolland marked this conversation as resolved.
Show resolved Hide resolved
"buffer": "^6.0.3",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.7.1",
Expand Down
26 changes: 13 additions & 13 deletions src/App.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import '~ol/ol.css';
@import './variables.less';

.App,
Expand All @@ -7,20 +6,21 @@
padding: 0;
height: 100%;
width: 100%;
}

.ol-control button {
background-color: @primary-color;
&:focus,
&:hover {
background-color: @primary-color;
.ol-control button {
background-color: var(--primaryColor);
&:focus,
&:hover {
background-color: var(--primaryColor);
}
}
}

.ol-attribution.ol-uncollapsible {
bottom: @footerHeight;
}
.ol-attribution.ol-uncollapsible {
bottom: @footerHeight;
}

.ol-attribution {
bottom: calc(@footerHeight + 0.5em);
.ol-attribution {
bottom: calc(@footerHeight + 0.5em);
right: 1em;
}
}
11 changes: 9 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ import ToolMenu from './components/ToolMenu';

import './App.less';

export const App: React.FC = (): JSX.Element => {
export interface AppProps extends React.ComponentProps<'div'> { };

export const App: React.FC<AppProps> = ({
...restProps
}): JSX.Element => {
return (
<div className="App">
<div
className="App"
{...restProps}
>
<Header />
<BasicMapComponent />
<ToolMenu />
Expand Down
10 changes: 5 additions & 5 deletions src/components/Footer/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
margin-bottom: 0;
z-index: 2;

background-color: fade(lighten(@primary-color, 25%), 90%);
background-color: var(--primaryColor);;
display: flex;
padding: 0 .5rem;
box-shadow: @componentShadow;
Expand All @@ -18,7 +18,7 @@
.item-container {
display: flex;
align-items: center;
color: darken(@primary-color, 40%);
color: var(--complementaryColor);

&.left-items {
justify-content: flex-start;
Expand All @@ -38,8 +38,8 @@
&-inner {
border-width: 1px;
border-style: solid;
border-color: darken(@primary-color, 40%);
color: darken(@primary-color, 40%);
border-color: var(--primaryColor);
color: var(--complementaryColor);
border-top: none;
text-align: center;
margin: 1px;
Expand Down Expand Up @@ -69,7 +69,7 @@

>button {
padding: 0 10px;
color: darken(@primary-color, 40%);
color: var(--complementaryColor);

>span {
text-decoration: underline;
Expand Down
3 changes: 2 additions & 1 deletion src/components/Header/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
margin-bottom: 0;
z-index: 2;

background-color: fade(lighten(@primary-color, 25%), 90%);
background-color: var(--primaryColor);
display: flex;
padding: 0 .5rem;
box-shadow: @componentShadow;
font-size: .95em;

.title {
color: var(--complementaryColor);
text-align: center;
font-size: 1.1rem;
font-weight: bold;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';

import LogoImg from '../../../resources/public/loading.png';
import {
useAppSelector
} from '../../hooks/useAppSelector';
Expand All @@ -15,6 +14,7 @@ export const Header: React.FC<HeaderProps> = ({
...restProps
}): JSX.Element => {
const title = useAppSelector((state) => state.title);
const logoPath = useAppSelector((state) => state.logoPath);

return (
<div
Expand All @@ -26,7 +26,7 @@ export const Header: React.FC<HeaderProps> = ({
>
<img
className="logo"
src={LogoImg}
src={logoPath}
/>
<div
className="title"
Expand Down
15 changes: 0 additions & 15 deletions src/components/ToolMenu/LayerTree/index.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.tool-menu .ant-menu .tree {
.layertree {
min-width: 25vw;

.ant-tree {
.ant-tree-treenode:first-of-type {
Expand All @@ -11,8 +10,6 @@
padding-bottom: 5px;
}

// .checkbox-style();

.ant-tree-node-selected,
.ant-tree-node-content-wrapper:hover {
background-color: transparent;
Expand All @@ -39,18 +36,6 @@
padding-left: 5px;
}

.ant-slider-track {
// background-color: rgb(var(--tetriaryColorR) var(--tetriaryColorG) var(--tetriaryColorB) / 80%);
}

.ant-slider-handle {
// border-color: var(--tertiaryColor);

&:focus {
// box-shadow: 0 0 0 5px rgb(var(--tetriaryColorR) var(--tetriaryColorG) var(--tetriaryColorB) / 10%)
}
}

.layer-transparency {
display: flex;
}
Expand Down
35 changes: 0 additions & 35 deletions src/components/ToolMenu/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,15 @@
max-width: 600px;

.ant-menu {
// background-color: @primary-color;
// color: var(--secondaryColor);

&.ant-menu-inline-collapsed {
width: 40px;
}

li:not(.ant-menu-item-only-child), li {
// border-bottom: solid 1px var(--secondaryColor);
}

li:last-child>span {
width: 100%;
}

.ant-menu-submenu-arrow {
// color: var(--secondaryColor);
}

.ant-menu-submenu-selected {
// color: var(--secondaryColor);
}

.ant-menu-sub.ant-menu-inline > .ant-menu-item {
height: auto;
width: 100%;
Expand All @@ -56,39 +42,19 @@

.ant-menu-submenu-title {
margin: 0;

&:hover {
// color: var(--secondaryColor);

.ant-menu-submenu-arrow {
// color: var(--secondaryColor);
}
}
}

.ant-menu-submenu-title:hover,
&.ant-menu-item-active {
// background-color: var(--tertiaryColor);
// color: var(--secondaryColor);
}

&.ant-menu-item-selected,
&.ant-menu-submenu-open {
// background-color: var(--primaryColor);
// color: var(--tertiaryColor);

>.ant-menu-submenu-title {
// border-bottom: solid 2px var(--tertiaryColor);
font-weight: bolder;
}

&::after {
display: none;
}

.ant-menu-submenu-arrow {
// color: var(--tertiaryColor);
}
}
}
}
Expand All @@ -98,7 +64,6 @@
.ant-menu-submenu-popup {
button,
button.react-geo-togglebutton {
// .button-style();
border: none !important;
border-radius: 0;
}
Expand Down
2 changes: 2 additions & 0 deletions src/index.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '~antd/dist/antd.variable.min.css';
@import '~ol/ol.css';
@import '~normalize.css/normalize.css';

body {
Expand Down
Loading