codexly-ui 0.4.6 → 0.4.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/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -850,7 +850,13 @@ class ClxButtonComponent {
|
|
|
850
850
|
? resolveRadius(this._themeSvc.config().borderRadius)
|
|
851
851
|
: BUTTON_SHAPE_FIXED[s];
|
|
852
852
|
const overflowClass = (this.badge() !== undefined && this.badge() !== null) ? 'overflow-visible' : 'overflow-hidden';
|
|
853
|
-
|
|
853
|
+
// If the consumer already positions the button (absolute/fixed/sticky), don't force
|
|
854
|
+
// `relative` — same-specificity utility classes are resolved by CSS source order, not
|
|
855
|
+
// template order, so `relative` from the base class can silently win over a consumer's
|
|
856
|
+
// `absolute`, leaving the button positioned in-flow instead of where it was placed.
|
|
857
|
+
const isPositioned = /(^|\s)(absolute|fixed|sticky)(\s|$)/.test(this._consumerClass);
|
|
858
|
+
const base = (isPositioned ? BUTTON_BASE_CLASS.replace(/^relative\s/, '') : BUTTON_BASE_CLASS)
|
|
859
|
+
.replace('overflow-hidden', overflowClass);
|
|
854
860
|
const consumer = this._consumerClass ? ` ${this._consumerClass}` : '';
|
|
855
861
|
return `${base} ${colorClass} ${sizeClass} ${shapeClass}${this.block() ? ' w-full' : ''}${consumer}`.trimEnd();
|
|
856
862
|
}, ...(ngDevMode ? [{ debugName: "_hostClass" }] : /* istanbul ignore next */ []));
|