rah_css_embed
Published under current TXP projects
Embed CSS-files directly to the page template.
Image: rah_css_embed
Intro and description
A Textpattern plugin that outputs CSS-files directly in the page template surrounded with style tags. This plugin is answer to request by the ghost.
List of features
- Embeds CSS to the page
- Simple tag to use
Installation and usage
The general behavior stands: paste plugin code to the plugin installer textarea and run the automatic setup. Then just activate the plugin and you are ready to use new tags that plugin includes like others.
For usage, basically just use <txp:rah_css_embed />-tag like the default core <txp:css />: put it inside sites head with wanted name-attribute. The tag will embed the CSS.
Attributes
The tag is <txp:rah_css_embed /> and attributes for it follow.
name
Name of the style to embed. Comma seperated list if multiple. When multiple stylesheets are selected, they are returned in alphabetical order.
Example: name="foo, bar" Default: "default"
type
Style element’s type attribute.
Example: type="" Default: "text/css"
title
XHTML title. Default is unset.
Example: title="Default style" Default: ""
media
Style element’s media attribute. Default is unset.
Example: media="all" Default: ""
html
Wrap css styles with HTML <style> tags, or not. Default value is 1, use style tags.
Example: html="0" Default: "1"
Example
Code:
<txp:rah_css_embed name="mystyle" />
Returns:
<style type="text/css">
body {
margin: 0;
background: #ccc;
color: #000;
}
</style>
Changelog
Version 0.3
- Added
htmlattribute.
Version 0.2
- Added support for list of multiple names.
- Added
typeattribute. - Added
mediaattribute. - Added
titleattribute. - Support for future TXP version that may not use base64 encoded style sheets.
Version 0.1
- Initial release.