HTML-DeferableCSS
view release on metacpan or search on metacpan
lib/HTML/DeferableCSS.pm view on Meta::CPAN
This method instantiates lazy attributes and performs some minimal
checks on the data. (This should be called instead of L</css_files>.)
It will throw an error or return false (depending on L</log>) if there
is something wrong.
This was added in v0.3.0.
=head2 href
my $href = $css->href( $alias );
This returns this URL for an alias.
=head2 link_html
my $html = $css->link_html( $alias );
This returns the link HTML markup for the stylesheet referred to by
C<$alias>.
=head2 inline_html
my $html = $css->inline_html( $alias );
This returns an embedded stylesheet referred to by C<$alias>.
=head2 link_or_inline_html
my $html = $css->link_or_inline_html( @aliases );
This returns either the link HTML markup, or the embedded stylesheet,
if the file size is not greater than L</inline_max>.
Note that a stylesheet will be inlined, even if there is are
L</cdn_links>.
=head2 deferred_link_html
my $html = $css->deferred_link_html( @aliases );
This returns the HTML markup for the stylesheets specified by
L</aliases>, as appropriate for each stylesheet.
If the stylesheets are not greater than L</inline_max>, then it will
embed them. Otherwise it will return the appropriate markup,
depending on L</defer_css>.
=for Pod::Coverage PATH NAME SIZE
=head1 KNOWN ISSUES
=head2 Content-Security-Policy (CSP)
If a web site configures a
L<Content-Security-Policy|https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP>
setting to disable all inlined JavaScript, then the JavaScript shim will
not work.
=head2 XHTML Support
This module is written for HTML5.
It does not support XHTML self-closing elements or embedding styles
and scripts in CDATA sections.
=head2 Encoding
All files are embedded as raw files.
No URL encoding is done on the HTML links or L</asset_id>.
=head2 It's spelled "Deferrable"
It's also spelled "Deferable".
=head1 SOURCE
The development version is on github at L<https://github.com/robrwo/HTML-DeferableCSS>
and may be cloned from L<git://github.com/robrwo/HTML-DeferableCSS.git>
=head1 BUGS
Please report any bugs or feature requests on the bugtracker website
L<https://github.com/robrwo/HTML-DeferableCSS/issues>
When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.
Please report any bugs in F<cssrelpreload.js> to
L<https://github.com/filamentgroup/loadCSS/issues>.
=head1 AUTHOR
Robert Rothenberg <rrwo@cpan.org>
This module was developed from work for Science Photo Library
L<https://www.sciencephoto.com>.
F<reset.css> comes from L<http://meyerweb.com/eric/tools/css/reset/>.
F<cssrelpreload.js> comes from L<https://github.com/filamentgroup/loadCSS/>.
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2020 by Robert Rothenberg.
This is free software, licensed under:
The MIT (X11) License
=cut
( run in 1.233 second using v1.01-cache-2.11-cpan-119454b85a5 )