waughj/html-stylesheet

Simple class for easy generation o' stylesheets.

0.1.0 2018-11-30 23:55 UTC

This package is auto-updated.

Last update: 2024-05-05 19:04:51 UTC


README

Simple class for easy generation o' stylesheets.

Use

Just call constructor with 1st argument a string representing the URL, & 2 optional arguments for a file loader & an array o' extra attributes to add to the HTML tag.

Example

WaughJ\HTMLStylesheet\HTMLStylesheet;

new HTMLStylesheet
(
	'main',
	new FileLoader([ 'directory-url' => 'https://www.example.com/css' ]),
	[ 'media' => 'print' ]
);

Will output:

<link href="https://www.example.com/css/main.css" rel="stylesheet" media="print" />