import { CodeSection } from "../../types/CodeSection"; import { StyleRule } from "../../types/style/StyleRule"; import { StyleProperty } from "../../types/style/StyleProperty"; import { StylePropertyType } from "../../types/style/StylePropertyType"; import { StyleBackgroundRule } from "../../types/style/StyleBackgroundRule"; import { StyleBorderRule } from "../../types/style/StyleBorderRule"; import { StyleColorRule } from "../../types/style/StyleColorRule"; import { StyleFontRule } from "../../types/style/StyleFontRule"; import { StyleMarginRule } from "../../types/style/StyleMarginRule"; import { StylePaddingRule } from "../../types/style/StylePaddingRule"; import { renderBackground } from "./properties/background"; import { renderBorder } from "./properties/border"; import { renderColor } from "./properties/color"; import { renderFont } from "./properties/font"; import { renderMargin } from "./properties/margin"; import { renderPadding } from "./properties/padding"; import { renderFloat } from "./properties/float"; import { StyleFoatRule } from "../../types/style/StyleFloatRule"; export function renderStyle( { content }: CodeSection ) { const style = content as StyleRule; return ( ``); } function renderProperties( properties: StyleProperty[] ) { return properties.map( (property: StyleProperty) => { switch( property.type ) { case StylePropertyType.Background: return renderBackground( property as StyleBackgroundRule ); case StylePropertyType.Border: return renderBorder( property as StyleBorderRule ); case StylePropertyType.Color: return renderColor( property as StyleColorRule ); case StylePropertyType.Font: return renderFont( property as StyleFontRule ); case StylePropertyType.Margin: return renderMargin( property as StyleMarginRule ); case StylePropertyType.Padding: return renderPadding( property as StylePaddingRule ); case StylePropertyType.Float: return renderFloat( property as StyleFoatRule ); } }).join('\n'); }