Add much better system for style lists in Input.astro, and format.
This commit is contained in:
parent
0caa823ad6
commit
171a163531
5 changed files with 4177 additions and 1661 deletions
|
|
@ -6,18 +6,20 @@ import sitemap from "@astrojs/sitemap";
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
site: "https://aluu.xyz",
|
site: "https://aluu.xyz",
|
||||||
integrations: [sitemap({
|
integrations: [
|
||||||
lastmod: new Date(),
|
sitemap({
|
||||||
i18n: {
|
lastmod: new Date(),
|
||||||
locales: {
|
i18n: {
|
||||||
en: "en-US",
|
locales: {
|
||||||
jp: "ja-JP",
|
en: "en-US",
|
||||||
|
jp: "ja-JP",
|
||||||
|
},
|
||||||
|
defaultLocale: "en",
|
||||||
},
|
},
|
||||||
defaultLocale: "en"
|
}),
|
||||||
}
|
],
|
||||||
})],
|
|
||||||
output: "hybrid",
|
output: "hybrid",
|
||||||
adapter: node({
|
adapter: node({
|
||||||
mode: "middleware"
|
mode: "middleware",
|
||||||
})
|
}),
|
||||||
});
|
});
|
||||||
2
index.js
2
index.js
|
|
@ -151,7 +151,7 @@ app.get("/robots.txt", (req, res) => {
|
||||||
} else {
|
} else {
|
||||||
res.sendFile(path.join(process.cwd(), "dist/client/robots-deny.txt"));
|
res.sendFile(path.join(process.cwd(), "dist/client/robots-deny.txt"));
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
app.get("/search", async (req, res) => {
|
app.get("/search", async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const { query } = req.query;
|
const { query } = req.query;
|
||||||
|
|
|
||||||
5755
pnpm-lock.yaml
generated
5755
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,5 +1,18 @@
|
||||||
---
|
---
|
||||||
const { inputName, defaultTextContent, height, placeholder, className, defaultStyles = true } = Astro.props;
|
const {
|
||||||
|
inputName,
|
||||||
|
defaultTextContent,
|
||||||
|
height,
|
||||||
|
placeholder,
|
||||||
|
className,
|
||||||
|
defaultStyles = true,
|
||||||
|
} = Astro.props;
|
||||||
|
|
||||||
|
const styleList = className ? className.split(" ") : [];
|
||||||
|
|
||||||
|
if (defaultStyles) {
|
||||||
|
styleList.push("astro-input");
|
||||||
|
}
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
inputName: string;
|
inputName: string;
|
||||||
|
|
@ -17,27 +30,5 @@ interface Props {
|
||||||
placeholder={placeholder || ""}
|
placeholder={placeholder || ""}
|
||||||
value={defaultTextContent || ""}
|
value={defaultTextContent || ""}
|
||||||
type="text"
|
type="text"
|
||||||
class={className}
|
class={styleList.map((style) => style).join(" ")}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{defaultStyles && <style>
|
|
||||||
input {
|
|
||||||
font-size: 16px;
|
|
||||||
width: 100%;
|
|
||||||
border: 2px solid var(--background-highlight);
|
|
||||||
border-radius: 10px;
|
|
||||||
background-color: var(--accent-color);
|
|
||||||
color: var(--text-color);
|
|
||||||
transition: 0.1s ease-in-out;
|
|
||||||
}
|
|
||||||
input::placeholder {
|
|
||||||
color: var(--text-color);
|
|
||||||
}
|
|
||||||
input:focus {
|
|
||||||
outline: none;
|
|
||||||
border: 2px solid var(--text-color);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -199,6 +199,22 @@ const { title, optionalPreloads } = Astro.props;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
.astro-input {
|
||||||
|
font-size: 16px;
|
||||||
|
width: 100%;
|
||||||
|
border: 2px solid var(--background-highlight);
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: var(--accent-color);
|
||||||
|
color: var(--text-color);
|
||||||
|
transition: 0.1s ease-in-out;
|
||||||
|
}
|
||||||
|
.astro-input::placeholder {
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
.astro-input:focus {
|
||||||
|
outline: none;
|
||||||
|
border: 2px solid var(--text-color);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue