You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several cases where white space is necessary to apply HelixUI styles to inline elements.
JSX removes inline whitespace if element nodes are defined on separate physical lines than non-element nodes within JSX source code.
TL;DR
This JSX template
return(<buttonclassName="hxBtn">
Text Node
<hx-icontype="filter"></hx-icon></button>)
However, JSX stripped significant whitespace between the text node and the <hx-icon> that CSS expects to be present in order to distance the icon properly from the text.
Solution
When building React components, strategically add white-space-only text nodes into JSX templates using the { " " } syntax.
This JSX template
return(<buttonclassName="hxBtn">
Text Node
{" "}<hx-icontype="filter"></hx-icon></button>)
See HelixDesignSystem/helix-ui#283 for details.
Problem
There are several cases where white space is necessary to apply HelixUI styles to inline elements.
JSX removes inline whitespace if element nodes are defined on separate physical lines than non-element nodes within JSX source code.
TL;DR
This JSX template
renders to
However, JSX stripped significant whitespace between the text node and the
<hx-icon>
that CSS expects to be present in order to distance the icon properly from the text.Solution
When building React components, strategically add white-space-only text nodes into JSX templates using the
{ " " }
syntax.This JSX template
renders to
This time, JSX inserts the needed white space between the text node and
<hx-icon>
element.The text was updated successfully, but these errors were encountered: