diff --git a/packages/stacks-classic/lib/components/description/description.less b/packages/stacks-classic/lib/components/description/description.less index 6a999981dd..60386caa47 100644 --- a/packages/stacks-classic/lib/components/description/description.less +++ b/packages/stacks-classic/lib/components/description/description.less @@ -17,11 +17,8 @@ --_de-fc: var(--yellow-400); } - .has-form-input({ - padding-bottom: var(--su8); - }); - color: var(--_de-fc); font-size: var(--fs-body1); + margin-bottom: 0; padding: 0 var(--su2); // Helps the label visually line up with inputs } diff --git a/packages/stacks-classic/lib/components/form-group/form-group.less b/packages/stacks-classic/lib/components/form-group/form-group.less index 8948599f42..39fbb9e211 100644 --- a/packages/stacks-classic/lib/components/form-group/form-group.less +++ b/packages/stacks-classic/lib/components/form-group/form-group.less @@ -16,7 +16,13 @@ legend.s-label { margin-bottom: var(--su8); } - + + &:has(.s-input, .s-textarea, .s-select) { + .s-label + .s-description { + margin-top: var(--sun8); + } + } + flex-direction: var(--_fg-fd); diff --git a/packages/stacks-classic/lib/components/input-message/input-message.less b/packages/stacks-classic/lib/components/input-message/input-message.less index a6fab7014c..6674baf360 100644 --- a/packages/stacks-classic/lib/components/input-message/input-message.less +++ b/packages/stacks-classic/lib/components/input-message/input-message.less @@ -45,5 +45,6 @@ color: var(--_im-fc); font-size: var(--fs-caption); + margin-bottom: 0; padding: var(--su2); } diff --git a/packages/stacks-classic/lib/components/label/label.less b/packages/stacks-classic/lib/components/label/label.less index 38ca6582ad..6d5ec38a85 100644 --- a/packages/stacks-classic/lib/components/label/label.less +++ b/packages/stacks-classic/lib/components/label/label.less @@ -1,7 +1,6 @@ .s-label { --_la-c: unset; --_la-fs: var(--fs-body2); // 16 - --_la-pb: 0; // CONTEXTUAL STYLES &[for] { @@ -30,9 +29,6 @@ // Sizes &&__sm { --_la-fs: var(--fs-body1); // 14 - .has-form-input({ - --_la-pb: var(--su4); - }); } &&__lg { @@ -43,7 +39,10 @@ .s-badge { font-weight: 400; margin-left: var(--su6); - vertical-align: middle; + } + &:has(.s-badge) { + display: flex; + align-items: center; } // TODO we shouldn't support descriptions and messages within labels @@ -56,21 +55,12 @@ padding: 0; } - .has-form-input({ - --_la-pb: var(--su8); - }); - - &:has(+ .s-description) { - --_la-pb: var(--su4); - } - cursor: var(--_la-c); font-size: var(--_la-fs); - color: var(--black-500); font-family: inherit; font-weight: 600; - padding: 0 var(--su2) var(--_la-pb); // Helps the label visually line up with inputs + padding: 0 var(--su2); // Helps the label visually line up with inputs } .s-required-symbol { @@ -80,18 +70,3 @@ line-height: 0; text-decoration: none !important; } - -// Helper mixin to apply styles to elements -// that have a form input sibling -.has-form-input(@rules) { - &:has( - ~ .s-input, - ~ * .s-input, - ~ .s-select, - ~ * .s-select, - ~ .s-textarea, - ~ * .s-textarea - ) { - @rules(); - } -} diff --git a/packages/stacks-docs/product/components/inputs.html b/packages/stacks-docs/product/components/inputs.html index d29f0d56bc..90ce0c900b 100644 --- a/packages/stacks-docs/product/components/inputs.html +++ b/packages/stacks-docs/product/components/inputs.html @@ -13,14 +13,14 @@
This will be shown only to employers and other Team members.
+This will be shown only to employers and other Team members.
This will be shown only to employers and other Team members.
+This will be shown only to employers and other Team members.
Required fields*