blaze-2d
Version:
A fast and simple WebGL 2 2D game engine written in TypeScript
30 lines (28 loc) • 968 B
JavaScript
import BlazeText from "./text";
const USSGapyYLwiX = document.createElement("style");
USSGapyYLwiX.textContent = `.blzHeading {
margin-bottom: 0.9ch;
}
`;
document.head.appendChild(USSGapyYLwiX);
import Logger from "../logger";
export default class BlazeHeading extends BlazeText {
/**
* Create a {@link BlazeHeading}.
*
* @param text The heading's text
* @param level The heading level (1 - 6)
* @param size The heading's font size in `rem` units, if none is given then size will be `auto`
*/
constructor(text, level = 1, size) {
if (level < 1 || level > 6)
throw Logger.error("BlazeHeading", "level must be between 1 and 6.");
super(text, level, size === undefined ? 0 : size, true);
this.element.classList.add("blzHeading");
if (size === undefined) {
this.size = undefined;
this.applyStyles();
}
}
}
//# sourceMappingURL=heading.js.map