bonchi

package module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2025 License: MIT Imports: 17 Imported by: 0

README

bonchi

A minimal web bundler with css preprocessing and js support.

Installation

go get github.com/Phillip-England/bonchi

Hello, World!

package main

import (
  "fmt"

  "github.com/Phillip-England/bonchi"
)

func main() {
  css, err := bonchi.BundleCss("./css", "./static/output.css")
  if err != nil {
    panic(err)
  }
  js, err := bonchi.BundleJs("./js", "./static/output.js")
  if err != nil {
    panic(err)
  }
  fmt.Println(css, js)
}

Target Dir

Bonchi is based off of a target directory. All the files in the directory will be bundled and processed for mixin support.

File Names and Ordering

File names can be used to order the way files are organized in the output. For example, 0.reset.css will be displayed first in the output, followed by 1.header.css and so on. The same goes for .js files as well.

Mixin

Any class can be used within another class using bonchi-mix:".className1 .className2";

.blue {
  background-color:skyblue;
}

.border {
  border:solid black 1px;
}

button {
  bonchi-mix:".blue .border";
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BundleCss added in v0.0.4

func BundleCss(inputDir string, out string) (string, error)

func BundleJs added in v0.0.4

func BundleJs(inputDir string, out string) (string, error)

func GetClassCssByName

func GetClassCssByName(css string, className string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL