import { GefestStyle } from "./modules/Gefest/style";
import { GefestElement } from "./modules/Gefest/element";

export abstract class SkeletonStyle extends GefestStyle {
    protected abstract navbar(element: GefestElement): void;
}

export class DarkStyle extends SkeletonStyle {
    navbar(element: GefestElement): void {
        element.addClass("dark-navbar");
    }

    applyStyle(html: string, element?: GefestElement): string {
        if (!element)
            element = GefestElement.fromHTML(html);
        element.addClass("bg-dark");
        element.addClass("text-light");
        this.navbar(element);
        return element.build(true);
    }
}

export class LightStyle extends SkeletonStyle {
    navbar(element: GefestElement): void {
        //element.addClass("light-navbar");
    }

    applyStyle(html: string, element?: GefestElement): string {
        if (!element)
            element = GefestElement.fromHTML(html);
        //element.addClass("light-mode");
        element.addClass("bg-light");
        element.addClass("text-dark");
        this.navbar(element);
        return element.build(true);
    }
}

export type SupportedStyles = SkeletonStyle;

export const defaultStyle = new LightStyle();