srcset

package
v0.0.0-...-5b50365 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package srcset is an srcset value parser.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageSource

type ImageSource struct {
	URL     string
	Width   int64
	Height  int64
	Density float64
}

ImageSource is a structure that contains an image definition.

func (ImageSource) String

func (s ImageSource) String() string

type SourceSet

type SourceSet []ImageSource

SourceSet is the result of parsing the value of a srcset attribute. A SourceSet consists of multiple ImageSource instances.

func Parse

func Parse(input string) SourceSet

Parse takes the value of a srcset attribute and parses it.

func (SourceSet) String

func (s SourceSet) String() string

Jump to

Keyboard shortcuts

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