cf-elements 1.0.5 → 1.0.7
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/cf-elements.js +13 -11
- package/package.json +1 -1
package/cf-elements.js
CHANGED
|
@@ -1054,7 +1054,8 @@
|
|
|
1054
1054
|
* bg-style - Background image style: cover, cover-center (default), parallax, w100, w100h100, no-repeat, repeat, repeat-x, repeat-y
|
|
1055
1055
|
* gradient - CSS gradient
|
|
1056
1056
|
* overlay - Overlay color (rgba)
|
|
1057
|
-
*
|
|
1057
|
+
* color - Default text color (inherited by child elements)
|
|
1058
|
+
* text-color - Alias for color
|
|
1058
1059
|
* link-color - Default link color
|
|
1059
1060
|
* font - Default font family (e.g., "Roboto") - inherited by child elements
|
|
1060
1061
|
* font-family - Alias for font
|
|
@@ -1070,7 +1071,8 @@
|
|
|
1070
1071
|
const bgStyle = attr(this, "bg-style");
|
|
1071
1072
|
const gradient = attr(this, "gradient");
|
|
1072
1073
|
const overlay = attr(this, "overlay");
|
|
1073
|
-
|
|
1074
|
+
// Support both "color" (simple) and "text-color" (explicit) for page text color
|
|
1075
|
+
const textColor = attr(this, "color") || attr(this, "text-color", "#334155");
|
|
1074
1076
|
const linkColor = attr(this, "link-color", "#3b82f6");
|
|
1075
1077
|
// Support both "font" (simple) and "font-family" (explicit) attributes
|
|
1076
1078
|
const font = attr(this, "font") || attr(this, "font-family");
|
|
@@ -1707,24 +1709,24 @@
|
|
|
1707
1709
|
}
|
|
1708
1710
|
|
|
1709
1711
|
// Build ID attribute for scroll-to and custom CSS targeting
|
|
1710
|
-
// ID goes on
|
|
1712
|
+
// ID goes on ColContainer so pagetree parser captures it correctly
|
|
1711
1713
|
const idAttr = elementId ? ` id="${elementId}"` : "";
|
|
1712
1714
|
const showAttr = show ? ` data-show="${show}"` : "";
|
|
1713
1715
|
|
|
1714
1716
|
// Only render col-inner if there's styling, otherwise just wrap content
|
|
1715
1717
|
let innerHtml;
|
|
1716
1718
|
if (hasColInnerStyling) {
|
|
1717
|
-
innerHtml = `<div
|
|
1719
|
+
innerHtml = `<div ${dataAttrs} style="${buildStyle(
|
|
1718
1720
|
innerStyles
|
|
1719
1721
|
)}">${overlayHtml}${contentHtml}</div>`;
|
|
1720
1722
|
} else {
|
|
1721
|
-
innerHtml = `<div
|
|
1723
|
+
innerHtml = `<div class="col-inner" style="${buildStyle(
|
|
1722
1724
|
innerStyles
|
|
1723
1725
|
)}">${contentHtml}</div>`;
|
|
1724
1726
|
}
|
|
1725
1727
|
|
|
1726
1728
|
this.outerHTML = `
|
|
1727
|
-
<div data-type="ColContainer/V1" data-span="${span}" data-col-direction="${align}"${showAttr} style="${buildStyle(
|
|
1729
|
+
<div${idAttr} data-type="ColContainer/V1" data-span="${span}" data-col-direction="${align}"${showAttr} style="${buildStyle(
|
|
1728
1730
|
colStyles
|
|
1729
1731
|
)}">
|
|
1730
1732
|
${innerHtml}
|
|
@@ -2179,7 +2181,7 @@
|
|
|
2179
2181
|
class CFHeadline extends CFElement {
|
|
2180
2182
|
render() {
|
|
2181
2183
|
const elementId = attr(this, "element-id");
|
|
2182
|
-
const size = attr(this, "size", "48px");
|
|
2184
|
+
const size = attr(this, "font-size") || attr(this, "size", "48px");
|
|
2183
2185
|
const weight = attr(this, "weight", "bold");
|
|
2184
2186
|
const font = attr(this, "font");
|
|
2185
2187
|
const color = attr(this, "color");
|
|
@@ -2275,7 +2277,7 @@
|
|
|
2275
2277
|
class CFSubheadline extends CFElement {
|
|
2276
2278
|
render() {
|
|
2277
2279
|
const elementId = attr(this, "element-id");
|
|
2278
|
-
const size = attr(this, "size", "24px");
|
|
2280
|
+
const size = attr(this, "font-size") || attr(this, "size", "24px");
|
|
2279
2281
|
const weight = attr(this, "weight", "normal");
|
|
2280
2282
|
const font = attr(this, "font");
|
|
2281
2283
|
const color = attr(this, "color");
|
|
@@ -2369,7 +2371,7 @@
|
|
|
2369
2371
|
class CFParagraph extends CFElement {
|
|
2370
2372
|
render() {
|
|
2371
2373
|
const elementId = attr(this, "element-id");
|
|
2372
|
-
const size = attr(this, "size", "16px");
|
|
2374
|
+
const size = attr(this, "font-size") || attr(this, "size", "16px");
|
|
2373
2375
|
const weight = attr(this, "weight", "normal");
|
|
2374
2376
|
const font = attr(this, "font");
|
|
2375
2377
|
const color = attr(this, "color");
|
|
@@ -2528,7 +2530,7 @@
|
|
|
2528
2530
|
// Always read attribute values - we need them for data attributes even if using styleguide
|
|
2529
2531
|
const bg = attr(this, "bg", "#3b82f6");
|
|
2530
2532
|
const color = attr(this, "color", "#ffffff");
|
|
2531
|
-
const size = attr(this, "size", "20px");
|
|
2533
|
+
const size = attr(this, "font-size") || attr(this, "size", "20px");
|
|
2532
2534
|
const weight = attr(this, "weight", "bold");
|
|
2533
2535
|
const px = attr(this, "px", "32px");
|
|
2534
2536
|
const py = attr(this, "py", "16px");
|
|
@@ -3551,7 +3553,7 @@
|
|
|
3551
3553
|
const textColor = attr(this, "text-color"); // No default - allows paint inheritance
|
|
3552
3554
|
const hasExplicitTextColor = this.hasAttribute("text-color");
|
|
3553
3555
|
const iconSize = attr(this, "icon-size", "16px");
|
|
3554
|
-
const size = attr(this, "size", "
|
|
3556
|
+
const size = attr(this, "font-size") || attr(this, "size", "16px"); // Direct px value or preset fallback
|
|
3555
3557
|
const gap = attr(this, "gap", "12px");
|
|
3556
3558
|
const itemGap = attr(this, "item-gap", "8px");
|
|
3557
3559
|
const align = attr(this, "align", "left");
|
package/package.json
CHANGED