The discussion revolves around the issue of inserting a space next to an emoji inside <kbd> tags. Canapin noticed that even though a space is present in the HTML code, it doesn’t render visibly.
Sam suggested that the issue might be due to the display: inline-flex; property applied to KBD tags. Canapin proposed a solution using the white-space property, but it had some drawbacks. Another alternative was to add left and/or right margins to the emoji using CSS.
Sam expressed uncertainty about the forced margins, and awesomerobot suggested using the gap property to add space between elements within the KBD tag. This solution was implemented, and awesomerobot merged the changes into the Discourse repository. Canapin thanked awesomerobot and expressed appreciation for learning about the gap property.
One solution is to add some values for the white-space property, like pre-wrap, but it will cause issues if we have one more multiple line breaks inside <kbd>.
Would become:
An alternative would be to automatically add left and/or right margins on the emoji if it’s not the first or last element.
Would these forced margins be acceptable? It’s prettier and increases readability, but it will be impossible for the user to not have a margin between the emoji and some text (as for me, I’d be happy since I see the forced margin as a benefit).