Skip to content

Commit

Permalink
Merge pull request #165 from BarthPaleologue/FixSassErrors
Browse files Browse the repository at this point in the history
Migrate scss import to fix warnings
  • Loading branch information
BarthPaleologue authored Nov 3, 2024
2 parents 9331a18 + f3a3a5d commit 4387ef8
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 44 deletions.
5 changes: 3 additions & 2 deletions src/styles/bodyEditor/panels.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use "sass:meta";
// This file is part of Cosmos Journeyer
//
// Copyright (C) 2024 Barthélemy Paléologue <barth.paleologue@cosmosjourneyer.com>
Expand Down Expand Up @@ -44,12 +45,12 @@
padding: 20px 10px 0 10px;
}

@import "../utils/colorPicker";
@include meta.load-css("../utils/colorPicker");

.range-slider {
margin-top: -5%;
}

@import "../utils/checkbox";
@include meta.load-css("../utils/checkbox");
}
}
4 changes: 3 additions & 1 deletion src/styles/helmetOverlay/currentMissionDisplay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

@use "../variables";

.currentMissionDisplay {
position: absolute;
top: 0;
Expand All @@ -25,7 +27,7 @@
flex-direction: column;

background: rgba(0, 0, 0, 0.5);
transition: $transition-time;
transition: variables.$transition-time;

&.completed {
background: rgba(0, 64, 0, 0.5);
Expand Down
7 changes: 4 additions & 3 deletions src/styles/helmetOverlay/helmetOverlay.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

@import "notifications.scss";
@use "sass:meta";
@use "notifications.scss";

@import "currentMissionDisplay.scss";
@use "currentMissionDisplay.scss";

#helmetOverlay {
position: absolute;
Expand All @@ -31,7 +32,7 @@

font-family: Nasalization, sans-serif;

@import "targetHelper.scss";
@include meta.load-css("targetHelper.scss");

.cursor {
position: absolute;
Expand Down
50 changes: 31 additions & 19 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@use "sass:meta";
@use "sass:color";

// This file is part of Cosmos Journeyer
Expand All @@ -17,13 +18,13 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

@use "variables";

@font-face {
font-family: 'Nasalization';
src: url('./nasalization/nasalization-rg.otf') format('opentype');
}

@import "variables";

*,
*::before,
*::after {
Expand All @@ -49,6 +50,17 @@
background: #555;
}

:root {
--text-size: 2vmin;
--h2-size: calc(1.5 * var(--text-size));
--h1-size: calc(2.0 * var(--text-size));
--menu-items-size: 3.2vmin;
--accent-color: #002b6a;
--accent-color-dark: #001a3f;
--accent-color-light: #003f9f;
--disabled-color: rgb(100, 100, 100);
}

body {
margin: 0;
overflow: hidden;
Expand All @@ -66,18 +78,18 @@ body {
top: 65vh;
left: 2.5vw;
transform: translateY(-50%);
transition: $transition-time ease-in-out;
transition: variables.$transition-time ease-in-out;

z-index: 10;

li {
color: white;
font-family: $main-font;
font-family: variables.$main-font;
font-size: var(--menu-items-size);
line-height: 1.5em;
cursor: pointer;
padding: 5px 20px;
transition: $transition-time;
transition: variables.$transition-time;

&:hover {
background: var(--accent-color);
Expand All @@ -98,31 +110,31 @@ body {
}
}

@import "bodyEditor/nav";
@include meta.load-css("bodyEditor/nav");

@import "bodyEditor/panels";
@include meta.load-css("bodyEditor/panels");

@import "helmetOverlay/helmetOverlay";
@include meta.load-css("helmetOverlay/helmetOverlay");

@import "spaceStationUI/spaceStationUI";
@include meta.load-css("spaceStationUI/spaceStationUI");

@import "pauseMenu/index.scss";
@include meta.load-css("pauseMenu/index.scss");

@import "mainMenu.scss";
@include meta.load-css("mainMenu.scss");

@import "inputs.scss";
@include meta.load-css("inputs.scss");

@import "loadingScreen.scss";
@include meta.load-css("loadingScreen.scss");

@import "targetCursors.scss";
@include meta.load-css("targetCursors.scss");

@import "starMapUI.scss";
@include meta.load-css("starMapUI.scss");

@import "tutorialLayer.scss";
@include meta.load-css("tutorialLayer.scss");

@import "tutorialsMenuPanel.scss";
@include meta.load-css("tutorialsMenuPanel.scss");

@import "inspectorLayer.scss";
@include meta.load-css("inspectorLayer.scss");

#renderer {
z-index: 1;
Expand All @@ -141,5 +153,5 @@ body {
background: rgba(0, 0, 0, .7);
}

@import "bodyEditor/toolbar";
@include meta.load-css("bodyEditor/toolbar");
}
2 changes: 2 additions & 0 deletions src/styles/mainMenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

@use "variables";

#mainMenu {
position: absolute;
width: 100vw;
Expand Down
8 changes: 5 additions & 3 deletions src/styles/spaceStationUI/spaceStationUI.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "../variables";

$gaps: 10px;

#spaceStationUI {
Expand All @@ -8,7 +10,7 @@ $gaps: 10px;
right: 0;
z-index: 2;

font-family: Nasalization, sans-serif;
font-family: variables.$main-font;

padding: $gaps;

Expand Down Expand Up @@ -130,11 +132,11 @@ $gaps: 10px;
outline: none;
border: none;
color: white;
font-family: $main-font;
font-family: variables.$main-font;
padding: 1.0vmin;
font-size: var(--text-size);

transition: $transition-time;
transition: variables.$transition-time;

&:hover {
background: var(--accent-color-light);
Expand Down
10 changes: 6 additions & 4 deletions src/styles/starMapUI.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "variables";

@keyframes loadingAnimation {
0% {
background-position: 100% 0;
Expand All @@ -23,7 +25,7 @@
pointer-events: none;
transform-origin: center;
scale: 1;
transition: scale $transition-time $bezier-overshoot;
transition: scale variables.$transition-time variables.$bezier-overshoot;
}

.systemIcons {
Expand Down Expand Up @@ -71,7 +73,7 @@
z-index: 5;

color: white;
font-family: $main-font;
font-family: variables.$main-font;
padding: 2vmin;

h2, p {
Expand All @@ -97,11 +99,11 @@
border: none;
cursor: none;
color: white;
font-family: $main-font;
font-family: variables.$main-font;
padding: 1.0vmin;
font-size: var(--text-size);

transition: $transition-time;
transition: variables.$transition-time;

&:hover {
background: var(--accent-color-light);
Expand Down
2 changes: 2 additions & 0 deletions src/styles/targetCursors.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "variables";

.targetCursorRoot {
--dim: 50px;
position: absolute;
Expand Down
13 changes: 1 addition & 12 deletions src/styles/variables.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
$main-font: "Nasalization", sans-serif;
$transition-time: 0.2s;
$bezier-overshoot: cubic-bezier(0.34, -1.87, 0.74, 2.99);
$backdrop-blur: blur(3px);

:root {
--text-size: 2vmin;
--h2-size: calc(1.5 * var(--text-size));
--h1-size: calc(2.0 * var(--text-size));
--menu-items-size: 3.2vmin;
--accent-color: #002b6a;
--accent-color-dark: #001a3f;
--accent-color-light: #003f9f;
--disabled-color: rgb(100, 100, 100);
}
$backdrop-blur: blur(3px);

0 comments on commit 4387ef8

Please sign in to comment.