srcset

package
v0.0.0-...-60192f8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 2 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.

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.

Jump to

Keyboard shortcuts

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