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 @@
{% highlight html %} -
+
-

This will be shown only to employers and other Team members.

+

This will be shown only to employers and other Team members.

-
+
@@ -29,7 +29,7 @@
-
+
@@ -39,19 +39,19 @@ {% endhighlight %}
-
+
-

This will be shown only to employers and other Team members.

+

This will be shown only to employers and other Team members.

-
+
{% icon "Lock", "s-input-icon fc-black-400" %}
-
+
@@ -107,16 +107,16 @@

Required fields*

-
-
+ +
-
+
-
+
@@ -129,16 +129,16 @@

Required fields*

- -
+ +
-
+
-
+
@@ -188,24 +188,24 @@

{% header "h4", "Warning" %}
{% highlight html %} -
+
@Svg.Alert.With("s-input-icon")
-

Caps lock is on! Having trouble entering your username?

+

Caps lock is on! Having trouble entering your username?

{% endhighlight %}
-
+
{% icon "Alert", "s-input-icon" %}
-

Caps lock is on! Having trouble entering your username?

+

Caps lock is on! Having trouble entering your username?

@@ -218,24 +218,24 @@

{% highlight html %} -
+
@Svg.AlertFill.With("s-input-icon")
-

You must provide a username. Forgot your username?

+

You must provide a username. Forgot your username?

{% endhighlight %}
-
+
{% icon "AlertFill", "s-input-icon" %}
-

You must provide a username. Forgot your username?

+

You must provide a username. Forgot your username?

@@ -244,24 +244,24 @@

{% header "h4", "Success" %}
{% highlight html %} -
+
@Svg.Checkmark.With("s-input-icon")
-

That name is available! Why do we require a username?

+

That name is available! Why do we require a username?

{% endhighlight %}
-
+
{% icon "Check", "s-input-icon" %}
-

That name is available! Why do we require a username?

+

That name is available! Why do we require a username?

@@ -345,7 +345,7 @@

{% header "h3", "Prepended inputs" %}
{% highlight html %} -
+
https://
@@ -356,7 +356,7 @@

{% endhighlight %}
-
+
https://
@@ -371,7 +371,7 @@

{% header "h3", "Appended inputs" %}
{% highlight html %} -
+
@@ -389,7 +389,7 @@

{% endhighlight %}
-
+
@@ -416,7 +416,7 @@

{% highlight html %} -
+
@@ -432,19 +432,21 @@

{% endhighlight %} -
- -
-
- - svelte - - +
+
+ +
+
+ + svelte + + +
+
-
diff --git a/packages/stacks-docs/product/components/labels.html b/packages/stacks-docs/product/components/labels.html index 7041267c13..f109459f5e 100644 --- a/packages/stacks-docs/product/components/labels.html +++ b/packages/stacks-docs/product/components/labels.html @@ -15,7 +15,7 @@ {% header "h2", "Base style" %}
{% highlight html %} - +
@@ -23,7 +23,7 @@ {% endhighlight %}
-
+
@@ -68,22 +68,22 @@
{% highlight html %} - -