/webstyle

Primary LanguageGoMIT LicenseMIT

webstyle

common css styles embedded in go templates

License Version pkg.go.dev

usage

import "go.seankhliao.com/webstyle"

components

layout

<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- head things -->
    <style>
      {{ template "BaseCss" }}
    </style>
  </head>
  <body>
    <header>
      {{ template "LogoHtml" }}
      <!-- optional parts -->
    </header>

    <main>
      <! --
        main content
        see base.css
      -->
    </main>

    {{ template "FooterHtml" }}
  </body>
</html>

base css

<style>
  {{ template "BaseCss" }}
</style>

assumes layout

header

<header>
  {{ template "LogoHtml" }}
  <!-- optional parts
  <h2>A subtitle</h2>
  <p>A tagline</p>
  -->
</header>

footer

{{ template "FooterHtml" }}

loader

<style>
  {{ template "LoaderCss" }}
</style>

{{ template "LoaderHtml" }}

develop

edit html / css files

go generate