diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-11-13 13:17:34 +0000 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-11-13 13:17:34 +0000 |
| commit | fcb3a5980606a1ab7f15fa9185f9684a7702b24f (patch) | |
| tree | 09bc65562a6533101e2f7d00b2a6f284e3bdeb70 /opendc-web/opendc-web-ui/src/components/topologies/map/controls | |
| parent | 9d06fb04319a50c26599f2da5387a2d03bee15ec (diff) | |
refactor(web/ui): Drop dependency on Sass
This change updates the OpenDC web UI to not rely on Sass for
stylesheets. CSS in combination with PostCSS has become powerful enough
for our use-cases as indicated by the small differences between the CSS
and SCSS versions of our files.
By switching to CSS, we can make use of Turbopack to build the project,
which is a re-implementation of Webppack in Rust and is able to build
projects much faster.
Diffstat (limited to 'opendc-web/opendc-web-ui/src/components/topologies/map/controls')
| -rw-r--r-- | opendc-web/opendc-web-ui/src/components/topologies/map/controls/Collapse.js | 2 | ||||
| -rw-r--r-- | opendc-web/opendc-web-ui/src/components/topologies/map/controls/Collapse.module.css (renamed from opendc-web/opendc-web-ui/src/components/topologies/map/controls/Collapse.module.scss) | 40 | ||||
| -rw-r--r-- | opendc-web/opendc-web-ui/src/components/topologies/map/controls/ScaleIndicator.js | 2 | ||||
| -rw-r--r-- | opendc-web/opendc-web-ui/src/components/topologies/map/controls/ScaleIndicator.module.css (renamed from opendc-web/opendc-web-ui/src/components/topologies/map/controls/ScaleIndicator.module.scss) | 0 | ||||
| -rw-r--r-- | opendc-web/opendc-web-ui/src/components/topologies/map/controls/Toolbar.js | 2 | ||||
| -rw-r--r-- | opendc-web/opendc-web-ui/src/components/topologies/map/controls/Toolbar.module.css | 27 | ||||
| -rw-r--r-- | opendc-web/opendc-web-ui/src/components/topologies/map/controls/Toolbar.module.scss | 29 |
7 files changed, 50 insertions, 52 deletions
diff --git a/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Collapse.js b/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Collapse.js index f54b7c84..931ded94 100644 --- a/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Collapse.js +++ b/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Collapse.js @@ -22,7 +22,7 @@ import PropTypes from 'prop-types' import { ChevronLeftIcon } from '@patternfly/react-icons' -import { collapseContainer } from './Collapse.module.scss' +import { collapseContainer } from './Collapse.module.css' import { Button } from '@patternfly/react-core' function Collapse({ onClick }) { diff --git a/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Collapse.module.scss b/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Collapse.module.css index 0c1fac94..70fd465f 100644 --- a/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Collapse.module.scss +++ b/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Collapse.module.css @@ -27,29 +27,29 @@ bottom: 10%; margin: auto 0; height: 50px; +} - button:global(.pf-m-tertiary) { - height: 100%; - padding: 2px; +.collapseContainer > button:global(.pf-m-tertiary) { + height: 100%; + padding: 2px; - margin-right: var(--pf-global--spacer--xs); - margin-top: var(--pf-global--spacer--xs); - background-color: var(--pf-global--BackgroundColor--100); - border: none; - border-radius: var(--pf-global--BorderRadius--sm); - box-shadow: var(--pf-global--BoxShadow--sm); + margin-right: var(--pf-global--spacer--xs); + margin-top: var(--pf-global--spacer--xs); + background-color: var(--pf-global--BackgroundColor--100); + border: none; + border-radius: var(--pf-global--BorderRadius--sm); + box-shadow: var(--pf-global--BoxShadow--sm); +} - &:not(:global(.pf-m-disabled)) { - background-color: var(--pf-global--BackgroundColor--100); - } +.collapseContainer > button:global(.pf-m-tertiary):not(:global(.pf-m-disabled)) { + background-color: var(--pf-global--BackgroundColor--100); +} - &:after { - display: none; - } +.collapseContainer > button:global(.pf-m-tertiary):after { + display: none; +} - &:hover { - border: none; - box-shadow: var(--pf-global--BoxShadow--md); - } - } +.collapseContainer > button:global(.pf-m-tertiary):hover { + border: none; + box-shadow: var(--pf-global--BoxShadow--md); } diff --git a/opendc-web/opendc-web-ui/src/components/topologies/map/controls/ScaleIndicator.js b/opendc-web/opendc-web-ui/src/components/topologies/map/controls/ScaleIndicator.js index 58d2ccc9..3ec893fb 100644 --- a/opendc-web/opendc-web-ui/src/components/topologies/map/controls/ScaleIndicator.js +++ b/opendc-web/opendc-web-ui/src/components/topologies/map/controls/ScaleIndicator.js @@ -1,7 +1,7 @@ import PropTypes from 'prop-types' import React from 'react' import { TILE_SIZE_IN_METERS, TILE_SIZE_IN_PIXELS } from '../MapConstants' -import { scaleIndicator } from './ScaleIndicator.module.scss' +import { scaleIndicator } from './ScaleIndicator.module.css' function ScaleIndicator({ scale }) { return ( diff --git a/opendc-web/opendc-web-ui/src/components/topologies/map/controls/ScaleIndicator.module.scss b/opendc-web/opendc-web-ui/src/components/topologies/map/controls/ScaleIndicator.module.css index f19e0ff2..f19e0ff2 100644 --- a/opendc-web/opendc-web-ui/src/components/topologies/map/controls/ScaleIndicator.module.scss +++ b/opendc-web/opendc-web-ui/src/components/topologies/map/controls/ScaleIndicator.module.css diff --git a/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Toolbar.js b/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Toolbar.js index e7dc57c3..00aaf3e1 100644 --- a/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Toolbar.js +++ b/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Toolbar.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types' import React from 'react' -import { control, toolBar } from './Toolbar.module.scss' +import { control, toolBar } from './Toolbar.module.css' import { Button } from '@patternfly/react-core' import { SearchPlusIcon, SearchMinusIcon, CameraIcon } from '@patternfly/react-icons' diff --git a/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Toolbar.module.css b/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Toolbar.module.css new file mode 100644 index 00000000..007389da --- /dev/null +++ b/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Toolbar.module.css @@ -0,0 +1,27 @@ +.toolBar { + position: absolute; + bottom: var(--pf-global--spacer--md); + left: var(--pf-global--spacer--xl); +} + +.control:global(.pf-m-tertiary) { + margin-right: var(--pf-global--spacer--xs); + margin-top: var(--pf-global--spacer--xs); + background-color: var(--pf-global--BackgroundColor--100); + border: none; + border-radius: var(--pf-global--BorderRadius--sm); + box-shadow: var(--pf-global--BoxShadow--sm); +} + +.control:global(.pf-m-tertiary):not(:global(.pf-m-disabled)) { + background-color: var(--pf-global--BackgroundColor--100); +} + +.control:global(.pf-m-tertiary):after { + display: none; +} + +.control:global(.pf-m-tertiary):hover { + border: none; + box-shadow: var(--pf-global--BoxShadow--md); +} diff --git a/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Toolbar.module.scss b/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Toolbar.module.scss deleted file mode 100644 index 0d505acc..00000000 --- a/opendc-web/opendc-web-ui/src/components/topologies/map/controls/Toolbar.module.scss +++ /dev/null @@ -1,29 +0,0 @@ -.toolBar { - position: absolute; - bottom: var(--pf-global--spacer--md); - left: var(--pf-global--spacer--xl); -} - -.control { - &:global(.pf-m-tertiary) { - margin-right: var(--pf-global--spacer--xs); - margin-top: var(--pf-global--spacer--xs); - background-color: var(--pf-global--BackgroundColor--100); - border: none; - border-radius: var(--pf-global--BorderRadius--sm); - box-shadow: var(--pf-global--BoxShadow--sm); - - &:not(:global(.pf-m-disabled)) { - background-color: var(--pf-global--BackgroundColor--100); - } - - &:after { - display: none; - } - - &:hover { - border: none; - box-shadow: var(--pf-global--BoxShadow--md); - } - } -} |
