@robert.tools/atom-text 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/index.css +2 -2
- package/src/index.njk +10 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robert.tools/atom-text",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A component to provide text elements.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dist",
|
|
16
16
|
"src/index.njk",
|
|
17
17
|
"src/index.css"
|
|
18
|
-
],
|
|
18
|
+
],
|
|
19
19
|
"scripts": {
|
|
20
20
|
"init": "robi init",
|
|
21
21
|
"release": "robi release",
|
package/src/index.css
CHANGED
package/src/index.njk
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
{% set tag = params.tag or "span" %}
|
|
2
|
-
{% set
|
|
3
|
-
{% set
|
|
2
|
+
{% set css_base = params.css or "text--standard" %}
|
|
3
|
+
{% set css_modifier = params.css_modifier or "" %}
|
|
4
|
+
{% set css = (css_base ~ " " ~ css_modifier) | trim %}
|
|
5
|
+
|
|
6
|
+
{% set id = ('id="' ~ (params.id) ~ '"') if params.id is defined else '' %}
|
|
4
7
|
|
|
5
8
|
{% set text = (params.prefix or "") ~ params.text ~ (params.suffix or "") %}
|
|
6
9
|
|
|
7
10
|
{% if params.text is defined %}
|
|
8
11
|
{% if tag == 'span' %}
|
|
9
|
-
<span class="{{css}}" data-
|
|
12
|
+
<span {{id}} class="{{css}}" data-component="text.atom">{{ text }}</span>
|
|
10
13
|
{% elif tag == 'h1' %}
|
|
11
|
-
<h1 class="{{css}}" data-
|
|
14
|
+
<h1 {{id}} class="{{css}}" data-component="text.atom">{{ text }}</h1>
|
|
12
15
|
{% elif tag == 'h2' %}
|
|
13
|
-
<h2 class="{{css}}" data-
|
|
16
|
+
<h2 {{id}} class="{{css}}" data-component="text.atom">{{ text }}</h2>
|
|
14
17
|
{% elif tag == 'h3' %}
|
|
15
|
-
<h3 class="{{css}}" data-
|
|
18
|
+
<h3 {{id}} class="{{css}}" data-component="text.atom">{{ text }}</h3>
|
|
16
19
|
{% elif tag == 'p' %}
|
|
17
|
-
<p class="{{css}}" data-
|
|
20
|
+
<p {{id}} class="{{css}}" data-component="text.atom">{{ text }}</p>
|
|
18
21
|
{% else %}
|
|
19
22
|
{{ text }}
|
|
20
23
|
{% endif %}
|