UNPKG

nehan

Version:

Html layout engine for paged-media written in Typescript

39 lines 1.36 kB
import { LogicalEdge, LogicalEdgeDirections, CssText, CssCascade, } from "./public-api"; export class LogicalBorderColor extends LogicalEdge { static parseShorthand(css_text) { let vs = CssText.getValue4D(css_text.value); return [ { prop: "border-before-color", value: vs[0] }, { prop: "border-end-color", value: vs[1] }, { prop: "border-after-color", value: vs[2] }, { prop: "border-start-color", value: vs[3] } ]; } static load(element) { return new LogicalBorderColor(LogicalEdgeDirections.reduce((colors, direction) => { colors[direction] = CssCascade.getValue(element, `border-${direction}-color`); return colors; }, {})); } static get none() { return new LogicalBorderColor(LogicalBorderColor.noneValue); } static get noneValue() { return { before: "transparent", end: "transparent", after: "transparent", start: "transparent" }; } clone() { return new LogicalBorderColor(this.values); } getPropByLogicalDirection(direction) { return `border-${direction}-color`; } acceptCssEvaluator(visitor) { return visitor.visitLogicalBorderColor(this); } } //# sourceMappingURL=logical-border-color.js.map