media

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Screen Computer screens, tablets, smartphones, and other screen-based devices.
	// Most common media type for interactive web content and applications.
	Screen = Media("screen")

	// Print Printed pages and print preview mode. Used for print-specific styling
	// and layout optimizations when users print web pages.
	Print = Media("print")

	// All All media types including screen, print, speech, and others.
	// Default value when no specific media targeting is needed.
	All = Media("all")

	// Speech Screen readers and speech synthesizers for accessibility.
	// Used for audio presentation and assistive technology optimization.
	Speech = Media("speech")

	// Mobile Mobile devices with screens up to 767px wide. Targets phones
	// and small mobile devices in portrait orientation.
	Mobile = Media("(max-width: 767px)")

	// Tablet Tablet devices with screens between 768px and 1023px wide.
	// Covers most tablets in both portrait and landscape modes.
	Tablet = Media("(min-width: 768px) and (max-width: 1023px)")

	// Desktop Desktop computers and large screens 1024px and wider.
	// Targets laptop screens, desktop monitors, and large displays.
	Desktop = Media("(min-width: 1024px)")

	// SmallMobile Small mobile phones with screens up to 479px wide.
	// Targets compact smartphones and narrow mobile devices.
	SmallMobile = Media("(max-width: 479px)")

	// LargeMobile Large mobile phones with screens between 480px and 767px.
	// Covers larger smartphones and phablet devices.
	LargeMobile = Media("(min-width: 480px) and (max-width: 767px)")

	// SmallTablet Small tablets and portrait iPad-sized devices.
	// Targets compact tablets and medium-sized screens.
	SmallTablet = Media("(min-width: 768px) and (max-width: 991px)")

	// LargeTablet Large tablets and laptop screens up to 1199px wide.
	// Covers landscape tablets and smaller laptop displays.
	LargeTablet = Media("(min-width: 992px) and (max-width: 1199px)")

	// LargeDesktop Large desktop screens and high-resolution displays.
	// Targets wide monitors, large laptops, and desktop computers.
	LargeDesktop = Media("(min-width: 1200px)")

	// Portrait Devices in portrait orientation where height exceeds width.
	// Common for mobile phones and rotated tablets.
	Portrait = Media("(orientation: portrait)")

	// Landscape Devices in landscape orientation where width exceeds height.
	// Common for desktop screens and rotated mobile devices.
	Landscape = Media("(orientation: landscape)")

	// Retina High-resolution displays with 2x pixel density or higher.
	// Targets Retina displays and other high-DPI screens for crisp graphics.
	Retina = Media("(-webkit-min-device-pixel-ratio: 2)")

	// HighDPI High-resolution displays with 192 DPI or higher pixel density.
	// Standard approach for targeting high-resolution screens and displays.
	HighDPI = Media("(min-resolution: 192dpi)")
)

Variables for Media values

Functions

This section is empty.

Types

type Media

type Media []byte

Media Media query constants for responsive design and device targeting. Predefined media queries for common breakpoints and device characteristics.

func Custom

func Custom(value string) Media

Custom allows setting a custom Media value for edge cases or future specifications. Use this when the predefined constants don't cover your specific use case.

Jump to

Keyboard shortcuts

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