Skip to content

Commit 3ab375d

Browse files
authored
Merge pull request #241 from jools-r/txp-css
Update txp:css
2 parents c70104d + ff227b8 commit 3ab375d

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

tags/css.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ The basic **css** tag is a *single* tag used to output the URL of the stylesheet
2828
Tag will accept the following attributes (**case-sensitive**) as well as the {% include atts-global-link.html %}:
2929

3030
`format="value"` <span class="footnote warning">v4.0.4+</span>
31-
: How to format output: either return complete [HTML link tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) with necessary HTML attributes, or only the stylesheet's URL. As of Textpattern 4.7.2 you can specify using physical (flat) files.
32-
: **Values:** `link`, `flat.link`, `url` or `flat.url`.
31+
: How to format output: either return complete [HTML link tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) with necessary HTML attributes, or only the stylesheet's URL. As of Textpattern 4.7.2 you can specify using physical (flat) files. As of Textpattern 4.9.0 you can output styles directly in the page sources.
32+
: **Values:** `link`, `flat.link`, `url`, `flat.url`, `inline` or `` (empty).
3333
: **Default:** `url`.
3434

3535
`media="value"` <span class="footnote warning">v4.0.4+</span>
@@ -103,8 +103,34 @@ Tag will accept the following attributes (**case-sensitive**) as well as the {%
103103
</head>
104104
~~~
105105

106+
### Example 6: Output CSS declarations in the page source wrapped in a style tag (v4.9.0+)
107+
108+
~~~ html
109+
<head>
110+
<!-- …tags… -->
111+
<txp:css name="theme-styles" format="inline" />
112+
<!-- …more tags… -->
113+
</head>
114+
~~~
115+
116+
### Example 7: Output CSS declarations with a custom wrapper tag (v4.9.0+)
117+
118+
~~~ html
119+
<head>
120+
<!-- …tags… -->
121+
<style nonce="foo-bar-baz">
122+
<txp:css name="theme-styles" format="" />
123+
</style>
124+
<!-- …more tags… -->
125+
</head>
126+
~~~
127+
106128
## Genealogy
107129

130+
### Version 4.9.0
131+
132+
`inline` and `` (empty) values added to `format` attribute.
133+
108134
### Version 4.7.2
109135

110136
`flat.link` and `flat.url` values added to `format` attribute.

0 commit comments

Comments
 (0)