- From: Brandon McConnell via GitHub <sysbot+gh@w3.org>
- Date: Thu, 15 Jun 2023 22:48:30 +0000
- To: public-css-archive@w3.org
@tabatkins Ah, so when dealing with markup generated by JS, would we need to do some sort of splitting abstraction like this? ([REPL](https://svelte.dev/repl/ad52ca9f882b4e36b15452aef3c75cc5?version=3.59.1)) ```html <script> const allText = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sollicitudin magna a iaculis maximus. Proin eleifend ligula enim, suscipit semper est condimentum ac. Donec semper scelerisque neque sed ultricies. Aliquam ut scelerisque orci. Nullam et orci nec massa gravida porttitor. Maecenas dui dui, eleifend at fringilla quis, convallis eget elit. Mauris volutpat felis a magna finibus, quis venenatis ex laoreet. Nulla ac nisi urna. Mauris ut sapien sit amet mi sollicitudin mattis. Nulla finibus efficitur placerat. Morbi fringilla aliquet quam non posuere. Nullam sodales nisl ut ipsum varius, sit amet iaculis elit fringilla. Phasellus sit amet sem auctor ex ullamcorper.'; const words = allText.split(' '); const lastWord = words.slice(-1)[0]; const textBeforeNoBreak = words.slice(0, -1).join(' '); </script> ``` ```html {textBeforeNoBreak} <nobr> {lastWord} <div class="attachment"> <div class="icon">🌴</div> <div class="icon">🍫</div> </div> </nobr> ``` ```html <style> .attachment { display: inline-block; white-space: nowrap; padding-left: 1ch; } .icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; aspect-ratio: 1; background: #eee; border-radius: 50%; } </style> ``` It'd be great to not have to reply on JS to attach some elements like this to the text to ensure it doesn't get orphaned, similarly to how we can currently can do the same for text using ` ` -- GitHub Notification of comment by brandonmcconnell Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8972#issuecomment-1593815756 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 15 June 2023 22:48:32 UTC