Adding package file to theme and using scss instead of css.

This commit is contained in:
calcu1on 2025-04-21 08:13:05 -04:00
parent 3bd38b2d80
commit 967de436f6
7 changed files with 139 additions and 13 deletions

View File

@ -1,12 +1,65 @@
/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
box-sizing: border-box;
}
/* 2. Remove default margin */
* {
margin: 0;
}
/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
html {
interpolate-size: allow-keywords;
}
}
body {
color: white;
background: purple;
max-width: 95%;
/* 4. Add accessible line-height */
line-height: 1.5;
/* 5. Improve text rendering */
-webkit-font-smoothing: antialiased;
}
/* 6. Improve media defaults */
img, picture, video, canvas, svg {
display: block;
margin: auto;
max-width: 100%;
}
/* 7. Inherit fonts for form controls */
input, button, textarea, select {
font: inherit;
}
/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
overflow-wrap: break-word;
}
/* 9. Improve line wrapping */
p {
text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
text-wrap: balance;
}
/*
10. Create a root stacking context
*/
#root, #__next {
isolation: isolate;
}
body {
background: orange;
}
img {
max-width: 100%;
display: block;
}
}
/*# sourceMappingURL=style.css.map */

View File

@ -0,0 +1 @@
{"version":3,"sourceRoot":"","sources":["../../theme/reset.scss","../../theme/styles.scss"],"names":[],"mappings":"AAAA;AACA;EACE;;;AAGF;AACA;EACE;;;AAGF;AACA;EACE;IACE;;;AAIJ;AACE;EACA;AACA;EACA;;;AAGF;AACA;EACE;EACA;;;AAGF;AACA;EACE;;;AAGF;AACA;EACE;;;AAGF;AACA;EACE;;;AAEF;EACE;;;AAGF;AAAA;AAAA;AAGA;EACE;;;AClDF;EACE;;;AAGF;EACE;EACA","file":"style.css"}

View File

@ -1,14 +1,7 @@
<!Doctype html>
<!DOCTYPE HTML>
<html>
<head>
<title>About</title>
<style>
body {
background: purple;
padding: 20px;
color: white;
}
</style>
</head>
<body>
<h1>This is the about page!</h1>

View File

@ -95,3 +95,7 @@ fn return_response(path_or_code: &str) -> String {
let length = contents.len();
format!("{status_line}\r\nContent-Length: {length}\r\n\r\n{contents}")
}
pub fn path_exists(path: &str) -> bool {
fs::metadata(path).is_ok()
}

11
theme/package.json Normal file
View File

@ -0,0 +1,11 @@
{
"name": "batflip",
"version": "1.0.0",
"description": "Theme for Batflip scoring.",
"main": "index.js",
"scripts": {
"build": "sass styles.scss ../public/assets/style.css"
},
"author": "Dan Chadwick",
"license": "MIT"
}

54
theme/reset.scss Normal file
View File

@ -0,0 +1,54 @@
/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
box-sizing: border-box;
}
/* 2. Remove default margin */
* {
margin: 0;
}
/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
html {
interpolate-size: allow-keywords;
}
}
body {
/* 4. Add accessible line-height */
line-height: 1.5;
/* 5. Improve text rendering */
-webkit-font-smoothing: antialiased;
}
/* 6. Improve media defaults */
img, picture, video, canvas, svg {
display: block;
max-width: 100%;
}
/* 7. Inherit fonts for form controls */
input, button, textarea, select {
font: inherit;
}
/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
overflow-wrap: break-word;
}
/* 9. Improve line wrapping */
p {
text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
text-wrap: balance;
}
/*
10. Create a root stacking context
*/
#root, #__next {
isolation: isolate;
}

10
theme/styles.scss Normal file
View File

@ -0,0 +1,10 @@
@import "reset";
body {
background: orange;
}
img {
max-width: 100%;
display: block;
}