Files
dealplustech/node_modules/astro/components/Font.astro
Kunthawat Greethong 6562a1748f fix: Fix product page syntax errors
1. Remove duplicate/broken code in product tables section
2. Fix PostCSS config for Tailwind 4
3. Add @tailwindcss/postcss dependency
4. Remove --production flag from Dockerfile (sharp required)

All fixes enable successful Docker build with favicon working.
2026-03-03 14:57:46 +07:00

37 lines
1.2 KiB
Plaintext

---
import * as mod from 'virtual:astro:assets/fonts/internal';
import { filterPreloads } from '../dist/assets/fonts/core/filter-preloads.js';
import { AstroError, AstroErrorData } from '../dist/core/errors/index.js';
// TODO: remove check when fonts are stabilized
const { componentDataByCssVariable } = mod;
if (!componentDataByCssVariable) {
throw new AstroError(AstroErrorData.ExperimentalFontsNotEnabled);
}
interface Props {
/** The `cssVariable` registered in your Astro configuration. */
cssVariable: import('astro:assets').CssVariable;
/** Whether it should output [preload links](https://web.dev/learn/performance/optimize-web-fonts#preload) or not. */
preload?: import('astro:assets').FontPreloadFilter;
}
const { cssVariable, preload = false } = Astro.props as Props;
const data = componentDataByCssVariable.get(cssVariable);
if (!data) {
throw new AstroError({
...AstroErrorData.FontFamilyNotFound,
message: AstroErrorData.FontFamilyNotFound.message(cssVariable),
});
}
const filteredPreloadData = filterPreloads(data.preloads, preload);
---
<style set:html={data.css}></style>
{
filteredPreloadData?.map(({ url, type }) => (
<link rel="preload" href={url} as="font" type={`font/${type}`} crossorigin />
))
}