Also bundle css with bun so it busts caches
And updates the `build.rs` script so that it also builds a manifest.txt for css files.
This commit is contained in:
79
frontend/css/styles.css
Normal file
79
frontend/css/styles.css
Normal file
@@ -0,0 +1,79 @@
|
||||
/* Global */
|
||||
|
||||
html {
|
||||
font-size: 18px;
|
||||
line-height: 1.6em;
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
|
||||
header.header nav {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
header.header nav h1 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
header.header nav a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
header.header nav ul {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
header.header nav ul li {
|
||||
margin-left: 16px;
|
||||
}
|
||||
|
||||
/* Home */
|
||||
|
||||
ul.entries {
|
||||
list-style: none;
|
||||
margin: 24px 8px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ul.entries li {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
ul.entries li em.domain {
|
||||
margin-left: 8px;
|
||||
color: rgba(0, 0, 0, 0.75);
|
||||
}
|
||||
|
||||
/* Log */
|
||||
|
||||
pre#log {
|
||||
font-size: 12px;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
|
||||
/* Entry */
|
||||
|
||||
article {
|
||||
max-width: 35em;
|
||||
margin: 0 auto;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
article span.published {
|
||||
font-size: 16px;
|
||||
line-height: 1.2em;
|
||||
}
|
||||
|
||||
article img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
@@ -2,5 +2,8 @@ import { Application } from "@hotwired/stimulus";
|
||||
|
||||
import LocalTimeController from "./local_time_controller";
|
||||
|
||||
// import CSS so it gets named with a content hash that busts caches
|
||||
import "../css/styles.css";
|
||||
|
||||
window.Stimulus = Application.start();
|
||||
window.Stimulus.register("local-time", LocalTimeController);
|
||||
@@ -12,7 +12,11 @@ export default class extends Controller {
|
||||
|
||||
get localTimeString(): string {
|
||||
if (this.utcTime) {
|
||||
return this.utcTime.toLocaleDateString();
|
||||
return this.utcTime.toLocaleDateString(window.navigator.language, {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
});
|
||||
}
|
||||
return "Unknown datetime"
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
"@hotwired/stimulus": "^3.2.1"
|
||||
},
|
||||
"name": "crawlnicle-frontend",
|
||||
"module": "hello_controller.ts",
|
||||
"module": "js/index.ts",
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"bun-types": "^0.6.0"
|
||||
|
||||
Reference in New Issue
Block a user