Happy Sunday! ☺️
Here are some useful CSS Tricks for Frontend Developers👩💻
All examples shown here.
0️⃣ Sticky Footer
Ensure your footer sticks to the bottom of the page, even if the content is short.
1️⃣ Custom Scrollbars
Style your scrollbars to match your site design using the ::-webkit-scrollbar pseudo-element.
2️⃣ Text Stroke
Create outlined text using -webkit-text-stroke.
3️⃣ Viewport Units for Typography
Scale text size based on the viewport using vw units.
4️⃣ CSS Grid Auto-Placement
Control the automatic placement of grid items with grid-auto-flow.
5️⃣ Aspect Ratio Box
Maintain aspect ratio with the padding trick.
6️⃣ Clip-Path for Custom Shapes
Create custom shapes using clip-path.
7️⃣ CSS Variables with JavaScript
Dynamically change CSS variables using JavaScript.
8️⃣ Object-Fit for Images and Videos
Control how media fits within a container using object-fit.
9️⃣ CSS Counters
Create custom counters with counter-reset and counter-increment.
Use these CSS tricks to enhance your frontend skills and create more dynamic and visually appealing web applications!
#CSS #WebDevelopment #Frontend #Tips #Tricks
@typical_ddev
Here are some useful CSS Tricks for Frontend Developers
All examples shown here.
Ensure your footer sticks to the bottom of the page, even if the content is short.
body {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.content {
flex: 1;
}
footer {
background: #333;
color: white;
text-align: center;
padding: 10px;
}
Style your scrollbars to match your site design using the ::-webkit-scrollbar pseudo-element.
::-webkit-scrollbar {
width: 20px;
}
Create outlined text using -webkit-text-stroke.
h1 {
-webkit-text-stroke: 2px black;
color: white;
}
Scale text size based on the viewport using vw units.
h1 {
font-size: 10vw;
}
Control the automatic placement of grid items with grid-auto-flow.
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
grid-auto-flow: dense;
}
Maintain aspect ratio with the padding trick.
.aspect-ratio-box {
width: 100%;
padding-top: 56.25%; /* 16:9 aspect ratio */
position: relative;
}
Create custom shapes using clip-path.
.clip-path {
clip-path: polygon(50% 0%, 0% 100%, 100% 100%); /* triabgle */
background: red;
width: 100px;
height: 100px;
}
Dynamically change CSS variables using JavaScript.
:root {
--main-color: #3498db;
}
function changeCssVar() {
document.documentElement.style.setProperty('--main-color', '#e74c3c');
}
Control how media fits within a container using object-fit.
img, video {
width: 100%;
height: 100%;
object-fit: cover;
}
Create custom counters with counter-reset and counter-increment.
.counter {
counter-reset: section;
}
.counter h2::before {
counter-increment: section;
content: "Section " counter(section) ": ";
}
Use these CSS tricks to enhance your frontend skills and create more dynamic and visually appealing web applications!
#CSS #WebDevelopment #Frontend #Tips #Tricks
@typical_ddev
Please open Telegram to view this post
VIEW IN TELEGRAM
codepen.io
CSS Tips
...
Tailwind CSS v4.0 is here 🔥
Yesterday my colleague told me about the new Tailwind 4 and I didnt expect that much changes.
Faster builds, modern features, and so much more - it’s packed with everything we’ve been waiting for. Let me list the most interesting and key things:
Insane Performance Boost📈
- Full builds are now 5x faster (yes, really)
- Incremental builds? 100x faster - perfect for quick iterations
Modern CSS Awesomeness🎨
- We finally have cascade layers
- Custom properties are registered automatically
- Plus, color-mix() support for advanced color manipulation
Setup Made Simple🛠
- All it takes is one line of code to get started
- And there’s a new Vite plugin that integrates beautifully
Customize in Your CSS👩💻
- Forget hunting through config files - just tweak directly in your CSS.
Cool New Features🆕
- Container queries for responsive magic.
- 3D transform utilities for some creative flair.
- Expanded gradient APIs for stunning visuals.
Full update log
#tailwind #webdev #frontenddeveloper #frontend
Yesterday my colleague told me about the new Tailwind 4 and I didnt expect that much changes.
Faster builds, modern features, and so much more - it’s packed with everything we’ve been waiting for. Let me list the most interesting and key things:
Insane Performance Boost
- Full builds are now 5x faster (yes, really)
- Incremental builds? 100x faster - perfect for quick iterations
Modern CSS Awesomeness
- We finally have cascade layers
- Custom properties are registered automatically
- Plus, color-mix() support for advanced color manipulation
Setup Made Simple
- All it takes is one line of code to get started
- And there’s a new Vite plugin that integrates beautifully
Customize in Your CSS
- Forget hunting through config files - just tweak directly in your CSS.
Cool New Features
- Container queries for responsive magic.
- 3D transform utilities for some creative flair.
- Expanded gradient APIs for stunning visuals.
Full update log
#tailwind #webdev #frontenddeveloper #frontend
Please open Telegram to view this post
VIEW IN TELEGRAM
Tailwindcss
Tailwind CSS v4.0
We just released Tailwind CSS v4.0 — an all-new version of the framework optimized for performance and flexibility, with a reimagined configuration and customization experience, and taking full advantage of the latest advancements the web platform has to…