Package style

import "gitlab.com/zoralab/bissetii/pkg/components/internal/style"

Package style is the full package for rendering HTML <style> tag.

The HTML template codes are written in Go’s string format under the corresponding group. This allows one to embed the HTML codes instead of parsing it from file.

Constants

All Bissetii Compressed Compiled CSS

const (
	CSSAMP          = ``

	CSSCritical     = ``

	CSSTablet       = ``

	CSSDesktop      = ``

	CSSWidescreen   = ``

	CSSPrint        = ``

	CSSVariables    = ``

	CSSVariablesAMP = ``
)

Constants for managing the package as a whole.

const (
	// Name is the block name (`{{- define "this-name" -}}`).
	Name = "style"

	// AMPName is the AMP HTML block name.
	AMPName = internal.AMPPrefix + Name

	// ParametersComment are the list of comment headers
	// describing inputs.
	ParametersComment = `
{{- /* .Type            = Style type= value                              */ -}}
{{- /* .Title           = Style title= value                             */ -}}
{{- /* .Media           = Style media= value                             */ -}}
{{- /* .Content         = Style content value                            */ -}}
`
)

Dependencies are the dependent codes for building independent template.

This is useful for rendering portable template usage like Hugo partials where they do not share a common definition source.

const (
	// DepHTML is the vanilla HTML output type.
	DepHTML = ``

	// DepAMPHTML is the Accelerated Mobile Pages HTML output
	// type.
	DepAMPHTML = ``
)

Full HTML codes for rendering templates without needing to parse file.

const (
	// HTML is the vanilla HTML output type.
	HTML = `
{{- if .Content }}
<style {{- if .Type }} {{ .Type -}} {{- end }}

{{- if .Title }}

	title="{{- .Title -}}"
{{- end }}

{{- if .Media }}

	media="{{- .Media -}}"
{{- end -}}
>
{{- .Content -}}
</style>
{{- end }}
`

	// AMPHTML is the Accelerated Mobile Pages HTML output type.
	AMPHTML = HTML
)

Data

type Data struct {
	Type    string
	Title   string
	Media   string
	Content string
}

Data is the data structure for rendering the component.