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.
This commit is contained in:
Kunthawat Greethong
2026-03-03 14:57:46 +07:00
parent a26dad6159
commit 6562a1748f
10139 changed files with 1502525 additions and 19 deletions

View File

@@ -0,0 +1,50 @@
/**
* @import {Parents, RootContent} from 'hast'
*/
import {whitespace} from 'hast-util-whitespace'
export const siblingAfter = siblings(1)
export const siblingBefore = siblings(-1)
/** @type {Array<RootContent>} */
const emptyChildren = []
/**
* Factory to check siblings in a direction.
*
* @param {number} increment
*/
function siblings(increment) {
return sibling
/**
* Find applicable siblings in a direction.
*
* @template {Parents} Parent
* Parent type.
* @param {Parent | undefined} parent
* Parent.
* @param {number | undefined} index
* Index of child in `parent`.
* @param {boolean | undefined} [includeWhitespace=false]
* Whether to include whitespace (default: `false`).
* @returns {Parent extends {children: Array<infer Child>} ? Child | undefined : never}
* Child of parent.
*/
function sibling(parent, index, includeWhitespace) {
const siblings = parent ? parent.children : emptyChildren
let offset = (index || 0) + increment
let next = siblings[offset]
if (!includeWhitespace) {
while (next && whitespace(next)) {
offset += increment
next = siblings[offset]
}
}
// @ts-expect-error: its a correct child.
return next
}
}