Most frontend engineers have encountered a common challenge when building virtualized lists with dynamic text, such as product descriptions and user messages. The need to measure each row's height before rendering can lead to performance issues, as throwing elements into the DOM for measurement can cause layout reflows and stuttering in the UI. Fortunately, there is a better solution: chenglou/pretext. This pure JS/TypeScript library for multiline text measurement and layout eliminates the need for DOM manipulation and reflows. By utilizing the browser's font engine via canvas, it accurately handles line breaking through pure arithmetic. Additionally, it addresses complex scenarios, including: – Bidirectional text – CJK characters – Emoji sequences – Multilingual line-break rules – Pre-wrap whitespace mode for textarea-style content Excitingly, a server-side rendering path is currently in development, enabling text layout at the infrastructure level, fully decoupled from the browser. For those working on performance-sensitive UIs, rich text editors, canvas-based tools, or design systems, this library is definitely worth bookmarking. 🔗 https://lnkd.in/eAh2DUuR #OpenSource #WebDev #JavaScript #TypeScript #FrontendPerformance #UIEngineering #TextLayout
Optimize Virtualized Lists with chenglou/pretext
More Relevant Posts
-
Capturing a Website as an Image Isn’t Simple Until you actually try to build it. What looks simple quickly turns into a real engineering challenge: • Styles don’t match • Fonts break • Performance drops • Layout Break Even popular libraries don’t fully solve the problem. 💡 One better approach: Instead of capturing the full DOM, export charts as images and build the report separately. It gives more control, better performance, and cleaner results — but also adds complexity. That’s the reality of frontend engineering: Simple features are rarely simple. . . . . . #frontend #reactjs #javascript #js #nextjs #webdevlopment #webdev #webapps #dashboard #reports Have you faced something like this?
To view or add a comment, sign in
-
Did you ever use display: contents? Most UI developers haven't. Or they tried it once and got confused. Here's what it does: → The container disappears (no box, no background, no padding) → But its children stay, taking their place in the layout When is it useful? ✅ Wrapping complex HTML without breaking grid/flex layouts ✅ Removing unwanted wrapper divs in component-based frameworks (Angular, React) ✅ Simplifying DOM structure without losing semantics When to avoid it? ❌ If you need the container for styling, events, or accessibility (focus management breaks) I've used it in Angular components to clean up nested structure while keeping screen reader support intact. Works beautifully when you know the trade-offs. Have you used it? Or is this new to you? #CSS #DisplayContents #UIDevelopment #Angular #FrontendTips #WebDevelopment #CSSLayout
To view or add a comment, sign in
-
-
🚀 CSS is evolving fast — and these new updates are game-changers for frontend developers. Here are 3 powerful additions you should know: 🔹 If-else in CSS – Write conditional styles without complex media queries 🔹 corner-shape – Create advanced shapes without relying on clip-path 🔹 @scope – Keep your styles clean and avoid global conflicts These features help write cleaner, more maintainable, and scalable CSS. 💡 If you're building modern UIs, it's time to start experimenting with these. Which one are you excited to try first? 👇 #FrontendDevelopment #CSS #WebDevelopment #SoftwareEngineering #UIUX
To view or add a comment, sign in
-
-
Automate your UI development with Boneyard. Generate pixel-perfect skeleton screens instantly and eliminate manual CSS coding for every component. . . . #frontend #webdevelopment #reactjs #uidesign #codingtools #softwareengineering #javascript #svelte #developerproductivity #skeletonscreens #boneyardjs #webdev #frontendengineering #programmingtips #techautomation . . . frontend development, skeleton screens, boneyard-js, react loading states, svelte 5, react native UI, web development tools, automated UI, CSS automation, frontend engineering tips, coding productivity, programming 2026, javascript libraries, UI design systems, loading animation tutorial
To view or add a comment, sign in
-
𝗖𝗦𝗦 𝗵𝗮𝘀 𝗼𝗳𝗳𝗶𝗰𝗶𝗮𝗹𝗹𝘆 𝗹𝗲𝘃𝗲𝗹𝗲𝗱 𝘂𝗽 𝗶𝗻 𝟮𝟬𝟮𝟲! 𝗦𝘁𝗼𝗽 𝗳𝗶𝗴𝗵𝘁𝗶𝗻𝗴 𝘄𝗶𝘁𝗵 𝘆𝗼𝘂𝗿 𝘀𝘁𝘆𝗹𝗲𝘀𝗵𝗲𝗲𝘁𝘀 𝗮𝗻𝗱 𝘀𝘁𝗮𝗿𝘁 𝘄𝗼𝗿𝗸𝗶𝗻𝗴 𝘄𝗶𝘁𝗵 𝘁𝗵𝗲𝗺. We've all been there staring at a div that refuses to center and copy-pasting Stack Overflow answers . But the truth is, modern CSS is now a powerful design engineering tool that can handle logic, animations, and responsive design natively saving us from heavy JavaScript workarounds . If you want to write cleaner, more maintainable code, here are 4 modern CSS tricks you should be using today: 💡 1. Clean Up with Flexbox Shorthands Why write three lines when one will do? Instead of writing out flex-grow, flex-shrink, and flex-basis separately, use the shorthand flex: 1 1 0 (or just flex: 1). It reduces CSS bloat and keeps your stylesheets much easier to read . 🎯 2. Use :has() The Parent Selector We Always Wanted For years, we had to rely on JavaScript to select a parent based on its child . Now, you can use the :has() pseudo-class to make components respond directly to their own content, replacing a surprising amount of JS . 🌊 3. Ditch Media Queries for clamp() Stop writing three separate media queries just to change a font size on mobile, tablet, and desktop . clamp(min, actual, max) handles fluid typography and spacing in one single line, letting the browser do all the math for you . 🎨 4. Build Smarter Palettes with oklch() Going back to hex values feels like cooking without tasting . oklch() is a color format where lightness is perceptually uniform to the human eye, making it incredibly powerful for building accessible dark/light modes programmatically . Understanding raw CSS deeply makes you a better frontend developer, full stop . 🤔 Quick question: Which of these modern features are you already using in your projects, and which ones are you still sleeping on? Let me know in the comments! 👇 #WebDevelopment #Frontend #JavaScript #TypeScript #CSS #WebDesign #CodingTips #Angular #React #NextJS #AngularDev #ReactJS #NextJSDev #FrontendDevelopment #FullStack #SoftwareEngineering #UIUX #TechTrends2026
To view or add a comment, sign in
-
🚀 CSS vs Tailwind CSS — Which one should you use? Both CSS and Tailwind CSS are powerful, but they serve different purposes in frontend development. 📌 CSS (Traditional) 🔹 Full control over styling 🔹 Custom design flexibility 🔹 Better for complex, unique UI 📌 Tailwind CSS (Utility-first) 🔹 Faster development 🔹 Reusable utility classes 🔹 Responsive design made easy 💡 Key Insight: CSS gives you freedom, while Tailwind gives you speed. The best developers know when to use both. Currently exploring modern frontend tools and improving UI skills step by step. 👉 Which one do you prefer — CSS or Tailwind? #CSS #TailwindCSS #WebDevelopment #Frontend #UIUX #Coding #Developers #Learning #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 CSS is evolving faster than ever… and honestly, it’s getting smarter too! Just came across these 3 powerful new CSS updates that can seriously level up how we write styles 👇 ✨ 1. If-Else in CSS No more messy media queries everywhere! Now we can write cleaner, conditional styles directly inside properties. Less code, more clarity 🙌 ✨ 2. Corner Shape Creating unique shapes just got easier. Say goodbye to complicated clip-path hacks and hello to simple, beautiful UI designs 🎨 ✨ 3. @scope Finally… better control over styling! No more worrying about styles leaking across components. Cleaner and safer CSS structure 🔥 💡 These updates may look small, but they can make a big difference in real-world projects — especially for building scalable and maintainable UI. As a frontend developer, this is exciting 👨💻 CSS is no longer just styling… it’s becoming more like a programming language! 👉 Which feature are you most excited to try? #CSS #WebDevelopment #FrontendDevelopment #UIUX #WebDesign #Developers #Coding
To view or add a comment, sign in
-
-
🚀 CSS is evolving faster than ever… and honestly, it’s getting smarter too! Just came across these 3 powerful new CSS updates that can seriously level up how we write styles 👇 ✨ 1. If-Else in CSS No more messy media queries everywhere! Now we can write cleaner, conditional styles directly inside properties. Less code, more clarity 🙌 ✨ 2. Corner Shape Creating unique shapes just got easier. Say goodbye to complicated clip-path hacks and hello to simple, beautiful UI designs 🎨 ✨ 3. @scope Finally… better control over styling! No more worrying about styles leaking across components. Cleaner and safer CSS structure 🔥 💡 These updates may look small, but they can make a big difference in real-world projects — especially for building scalable and maintainable UI. As a frontend developer, this is exciting 👨💻 CSS is no longer just styling… it’s becoming more like a programming language! 👉 Which feature are you most excited to try? #CSS #WebDevelopment #FrontendDevelopment #UIUX #WebDesign #Developers #Coding
To view or add a comment, sign in
-
-
CSS vs Tailwind CSS — Which one should you use? As a frontend developer, I’ve used both, and here’s a simple breakdown: 🔹 CSS (Traditional) ✔️ Full control over styling ✔️ Clean and readable classes ❌ Time-consuming for large projects ❌ Repetition of styles 🔹 Tailwind CSS ✔️ Faster development with utility classes ✔️ No need to switch between files ✔️ Easy to build responsive UI ❌ Messy class names in HTML ❌ Learning curve at the start 💡 My take: If you want full control and clean structure → go with CSS If you want speed and productivity → Tailwind is powerful 🚀 In real projects, many developers use a mix of both. What do you prefer? #css #tailwindcss #frontend #webdevelopment #coding
To view or add a comment, sign in
-
-
Most CSS layout bugs are not caused by Flexbox. They come from misunderstanding position. A button moves to the wrong place. A tooltip appears outside the screen. A modal sticks inside a parent. A sticky header refuses to stick. And suddenly: “CSS is broken.” It’s not. Usually, the real issue is choosing the wrong position.' Understanding these 5 values changes everything: static → default flow relative → moves from its normal position absolute → positioned relative to nearest positioned parent fixed → positioned relative to the viewport sticky → acts like relative, then sticks like fixed The most common mistake: Using absolute without setting relative on the parent. Result? Your element starts positioning itself based on the wrong ancestor—and debugging becomes painful. Simple rule: If child is absolute, parent usually needs relative. Another common mistake: Using fixed when sticky gives a much better UX. Especially for: ✔ Headers ✔ Sidebars ✔ Filters ✔ Navigation sections Good frontend development is not about memorizing CSS. It’s about understanding how the browser places things. Because sometimes the bug is not in your React code. It’s just one missing position: relative. What CSS positioning bug wasted the most time in your project? 👇 #CSS #FrontendDevelopment #WebDevelopment #ReactJS #JavaScript #SoftwareEngineering #UIEngineering #CleanCode
To view or add a comment, sign in
-
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development