🧐 Did you know you can now perform calculations on intrinsic size keywords like max-content? ❌ No JavaScript needed For years, web developers have faced a frustrating limitation: you couldn't use intrinsic size keywords like auto or min-content inside the calc() function. This meant complex workarounds, often involving JavaScript, for what should have been simple layout adjustments. Well, not anymore! The new calc-size() function is here to fix that. It allows you to perform calculations directly with these intrinsic values. This unlocks a new level of flexibility for creating dynamic and responsive components. How it works: The Syntax: property: calc-size(<calc-size-basis>, <calc-sum>); Imagine you need a container to be its max-content width plus a little extra padding: width: calc-size(max-content, size + 2rem); The size keyword acts as a variable for your basis (max-content in this case). Here are a few more examples: 🔹 Resolve to an auto value: width: calc-size(auto, size); 🔹 Nest other functions: width: calc-size(auto, round(up, size, 50px)); 💡 Quick Tip: If you only need to animate or transition between sizes without a calculation, check out interpolate-size: allow-keywords; instead. Read More: https://lnkd.in/dANGC2jC 𝗡𝗼𝘁𝗲 𝗼𝗻 𝗯𝗿𝗼𝘄𝘀𝗲𝗿 𝘀𝘂𝗽𝗽𝗼𝗿𝘁: This is a very new feature and still has limited support. As of now, it's available in Chrome 130+ and is on its way to other browsers. caniuse: https://lnkd.in/ds95GFW4) Reference articles: https://lnkd.in/dNiFay2J https://lnkd.in/dPhJc6Xn This is a fantastic step forward for native CSS capabilities. What's the first layout problem you'd solve with this? #CSS #CSSFunctions #WebDevelopment #Frontend #CodingTips #WebDesign #WebDev #DeveloperTips #itsmacr8
New calc-size() function for intrinsic size keywords
More Relevant Posts
-
🚀 CSS Just Got Smarter with the if() Function! 🖥️ Web developers, get ready to level up your stylesheets! The new CSS if() function, now experimental in Chrome 137, brings native conditional logic to CSS—no JavaScript or preprocessors needed. 🎉 This game-changer lets you dynamically set property values based on style queries, media queries, or feature support, making your designs more adaptive and efficient. Here’s a quick example to set padding based on a theme: :root { --theme: dark; } .element { padding: if(style(--theme: dark): 2rem; else: 1rem); } This checks the --theme custom property and applies 2rem padding for dark mode, falling back to 1rem otherwise. Clean, right? Or how about responsive design without extra media queries? .container { font-size: if(media(min-width: 768px): 1.5rem; else: 1rem); } The possibilities are endless: dynamic theming, feature detection, or even layout tweaks based on user preferences—all in pure CSS. While it’s still early (enable it in Chrome via chrome://flags), the CSS Working Group is pushing this in the Values Module Level 5 spec, and the dev community is buzzing with ideas! 💡 What do you think—will if() redefine how you write CSS? Drop your thoughts below or share your favorite use cases! 👇 #WebDevelopment #CSS #Frontend #TechInnovation
To view or add a comment, sign in
-
-
#frontend🔍 Understanding HTML Internals — How Browsers Actually Render Web Pages Most frontend engineers write HTML every day — but few truly understand what happens behind the scenes when the browser takes your code and turns it into a pixel-perfect webpage. So I created a short presentation: “HTML Internals — How Browsers Render Web Pages” 🧩 It dives deep into how browsers: 1️⃣ Parse HTML into the DOM tree 2️⃣ Build the CSSOM (CSS Object Model) 3️⃣ Combine both into a Render Tree 4️⃣ Execute layout, paint, and compositing 5️⃣ Handle scripts, fonts, and reflows efficiently ⚙️ Key Concepts Covered ✅ DOM & CSSOM construction ✅ Critical Rendering Path ✅ Reflow vs. Repaint ✅ Async vs. Defer in JavaScript ✅ Performance tips (resource hints, lazy loading, compression) ✅ Tools: Chrome DevTools, Lighthouse, WebPageTest 🚀 Why It Matters Understanding browser internals helps developers: 💡 Write faster, more efficient UIs 🧠 Debug render-blocking issues 🌍 Improve SEO and accessibility ⚡ Boost Core Web Vitals performance 🎯 Download the full PPT: 👉 HTML Internals — How Browsers Render Web Pages 📎 LinkedIn: https://lnkd.in/gBa5ea9G Let’s build not just great interfaces — but fast, efficient, and resilient ones 🚀 #FrontendDevelopment #WebPerformance #HTML #BrowserRendering #WebOptimization #CoreWebVitals #JavaScript #WebEngineering #HariMohan #ReactJS #NextJS #WebArchitecture
To view or add a comment, sign in
-
"Critical Rendering Path" in JavaScript - The Secret to Faster Websites! 🚀 Ever wondered what really happens between typing a URL and seeing the page appear on your screen? That’s where the Critical Rendering Path (CRP) comes in - the invisible journey your browser takes to turn HTML, CSS, and JS into pixels on your screen. 🧩 Let’s break it down 👇 What is the Critical Rendering Path? The Critical Rendering Path is the sequence of steps the browser follows to: 1️⃣ Parse your HTML → build the DOM (Document Object Model) 2️⃣ Parse your CSS → build the CSSOM (CSS Object Model) 3️⃣ Combine both → form the Render Tree 4️⃣ Calculate layout → figure out where everything should be 5️⃣ Paint → render pixels to the screen 🎨 Every step here adds time ⏳ and optimizing this path makes your site feel snappy⚡. Why JavaScript Matters Here? JavaScript can block rendering if not handled carefully. If your JS runs before the page is painted, the browser waits to execute it before showing content. ✅ defer ensures your JS runs after the HTML is parsed. ✅ async lets scripts download while the rest of the page loads (great for independent scripts). Quick Optimization Tips -> 🚀 Minimize render-blocking resources (CSS/JS in the head) ✅ defer → JS loads without blocking the DOM 📦 Inline critical CSS for above-the-fold content ✅ media="print" hack → async CSS loading 🧱 Lazy load images and non-critical scripts ✅ loading="lazy" → images load only when visible 🧩 Use compression & caching (gzip, brotli, CDN) 🧭 Visual Summary 🗂️ HTML → DOM 🎨 CSS → CSSOM 🌳 DOM + CSSOM → Render Tree 📏 Layout → sizes & positions 🖼️ Paint → pixels to screen That’s your Critical Rendering Path - the heartbeat of front-end performance ❤️ If you love learning how browsers actually work - 👉 Follow me for more deep dives into JavaScript, Web Performance & Frontend Magic! ✨ #JavaScript #WebPerformance #FrontendDevelopment #WebDev #PerformanceOptimization #CriticalRenderingPath #LearnJavaScript #FrontendTips #CodingCommunity #WebOptimization #DeveloperCommunity #AkshayPai #Reactjs #Angular #Frontend #WebDevelopment
To view or add a comment, sign in
-
-
👉 5 Pro Tips to Write Efficient Frontend Code ⚡🎨 Clean frontend = Faster apps + Happier users + Grateful developers. Here are 5 underrated tips that level up your code instantly 👇 ✅ 1. CSS Shorthands for Efficiency – Instead of writing margin-top, margin-right, margin-bottom, margin-left, just use margin: 10px 20px;. Saves time + lines of code. ✅ 2. Choosing the Right Layout Mode – Use Flexbox for one-dimensional layouts (row/column). – Use Grid for two-dimensional layouts (rows + columns). ✅ 3. Apply a CSS Reset – Browsers have default styles. Use a reset/normalize file to ensure consistency across all devices. ✅ 4. Use Dedicated HTML Tags – <nav> for navigation, <footer> for footers, <article> for content. Semantic tags = accessibility + SEO boost. ✅ 5. Always Add alt to Images – Helps screen readers, improves SEO, and shows text when images fail to load. #FrontendDevelopment #WebDevelopment #CSS #HTML #CleanCode #JavaScript #Accessibility #WebDesign #DeveloperTips #ProgrammingLife
To view or add a comment, sign in
-
🚀 Web Development Series – Day 15 🚀 Today, I created a simple calculator using HTML, CSS, and JavaScript! 🖥️✨ The calculator performs all basic operations: ➕ Addition ➖ Subtraction ✖️ Multiplication ➗ Division ✅ Key Highlights: Fully functional buttons linked to JS functions Clean and responsive UI with CSS styling Real-time calculation without page reload This project helped me strengthen my DOM manipulation and JS function linking skills, and it’s a step forward in building interactive web applications. 💡 Learning takeaway: Small projects like this are great to understand how HTML structure, CSS styling, and JS functionality work together seamlessly. 💡Here’s a sneak peek of the project 🖥️ : https://lnkd.in/gjbqMVdz #WebDevelopment #JavaScript #HTML #CSS #FrontendDevelopment #CodingJourney #30DaysOfCode #InteractiveProjects
To view or add a comment, sign in
-
🌐 HTML, CSS, JavaScript — The Art of Web Development Every great website begins with three core building blocks: HTML, CSS, and JavaScript. 🔹 HTML gives structure — it’s the backbone of every page, defining layout and content. 🔹 CSS adds style — turning simple pages into beautiful, visually engaging experiences. 🔹 JavaScript brings interactivity — making the web feel dynamic, alive, and responsive. Mastering these three isn’t just about code — it’s about learning how design and functionality come together to create meaningful user experiences. Whether you’re building your first portfolio site or designing a complex web app, remember this: ✨ Clean, semantic HTML and well-organized CSS are the foundations of intuitive, accessible, and beautiful products. If you’re just starting your journey, start small, experiment often, and focus on fundamentals — they’ll guide you through every framework and trend that follows. 💬 What was the first website you ever built — and what did you learn from it? #WebDevelopment #HTML #CSS #JavaScript #FrontEnd #Coding #LearnToCode #DeveloperJourney #WebDesign
To view or add a comment, sign in
-
-
New Project Launch — Gradient Generator! I just built a Dynamic Gradient Generator using HTML, CSS, and JavaScript, designed to help developers and designers easily create stunning background gradients for their websites. It’s clean, fast, and completely interactive — generate, preview, and copy your gradients instantly! Live Demo: https://lnkd.in/g-zz-P6f I’m consistently working on front-end projects to sharpen my skills and grow as a professional web developer. Excited to share more creative tools and experiments soon! If you want the project code, just comment below! #WebDevelopment #JavaScript #FrontendDeveloper #HTML #CSS #GradientGenerator #WebDesign #CreativeCoding #WebApp #OpenSource #Netlify #FrontendProjects #LearningByBuilding #FreelanceDeveloper #PortfolioProject #uiuxdesigner
To view or add a comment, sign in
-
I built a Click Counter App using HTML, CSS, and JavaScript 🎯 This simple yet powerful project helped me understand how events, DOM manipulation, and state management work together to make web pages interactive ⚡ link-[https://lnkd.in/gBHFDkam] 🧠 What I Learned: 1️⃣ How to capture user clicks using addEventListener() 2️⃣ How to update text dynamically using innerText or textContent 3️⃣ How to reset and style elements using CSS and JavaScript 4️⃣ How to make a minimal and responsive UI 💡 Tech Used: HTML → for structure CSS → for styling JavaScript → for interactivity Here’s a glimpse of how it works 👇 👉 Each time you click the button, the counter increases in real-time! A simple idea — but a great foundation for understanding event handling and DOM updates. 💬 Takeaway: Small projects like this might look simple, but they teach you the core of how browsers respond to user actions — the building blocks of every interactive website. 🚀 #Day31 #100DaysOfCode #JavaScript #DOM #EventHandling #WebDevelopment #FrontendDevelopment #CodingChallenge #CoderArmyDefence #LearningJourney #ClickCounter
To view or add a comment, sign in
-
Free: Image Comparison Creator (GrapesJS) I’ve released a small, free tool that lets you build Before/After image sections with GrapesJS and export them as ZIP. Note: this is a creation tool! The compare block is non-interactive inside the editor (images are stacked so you can easily replace them). The interactive slider is enabled in the exported HTML you download and open in the browser. What you can do: Upload your Before / After images Add titles, text, buttons, and layouts with GrapesJS Export standalone HTML or a ZIP with assets Host it anywhere it’s just HTML/CSS/JS Tech: HTML, CSS, JS, jQuery, Hammer.js, GrapesJS I’m sharing it to help designers, marketers, and devs ship before/after sections fast. Great for portfolios, product demos, real estate, and makeovers. Want the demo + download? https://lnkd.in/dZVMBfk8 #grapesjs #opensource #frontend #webdevelopment #javascript #nocode #imagecomparison #beforeafter #html5 #webtools
To view or add a comment, sign in
-
What really happens when a webpage loads?🤔 A webpage is often described as a combination of HTML, CSS, and JavaScript, but here’s how each of them actually plays its part 👇 1️⃣ HTML – The foundation. 👉 It’s the first file downloaded and parsed by the browser. 👉 It defines the structure and contains the links to CSS and JS files. 2️⃣ CSS – The stylist. 👉 Once linked, it’s fetched and applied to beautify the HTML structure. 3️⃣ JavaScript – The brain. 👉 After downloading, it interacts with the HTML through the DOM (Document Object Model), making real-time changes, adding interactivity, or updating content dynamically. 💡 In short: 👉 The HTML file loads and displays the webpage’s structure and design. 👉 The JavaScript file executes later, modifying or enhancing it dynamically. So next time you see a webpage appear — remember, it’s HTML doing the groundwork, CSS adding charm, and JS bringing it to life. ⚡ #WebDevelopment #HTML #CSS #JavaScript #Frontend #TechExplained #WebPerformance #LearnCoding #WebDesign
To view or add a comment, sign in
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