#css #frontend
Html struktura:
<div class="container">
<div class="centered-div">Markazlangan kontent</div>
</div>
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}.container {
display: grid;
place-items: center;
height: 100vh;
}.container {
position: relative;
height: 100vh;
}
.centered-div {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}// Gorizontal markazlash uchun, margin: auto
.centered-div {
width: 50%;
margin: 0 auto;
}
// Inline yoki inline-block elementlari uchun
.container {
text-align: center;
line-height: 100vh;
}
.centered-div {
display: inline-block;
vertical-align: middle;
line-height: normal;
}
@frontend
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥11👍10
#css #frontend
CSS , Tailwind yordamida yaratilgan ochiq manbali UI elementlari.
@frontend | Happy Coding
Please open Telegram to view this post
VIEW IN TELEGRAM
👍14🔥6
#css #frontend
Range Syntax orqali media queries’ga kiritiladigan qiymatlarning diapazonini an’anaviy min-width va max-width qiymatlaridan ko‘ra qisqaroq va osonroq ifodalash imkoniyatini beradi.
min-width va max-width
Brauzerlar qo‘llab-quvvatlashi 91.9%
Misollar:
@media (width >= 80rem) {
/* kenglik kamida 80rem bo'lganda */
}
/* Oraliq belgilash */
@media (80rem <= width <= 120rem) {
/* kenglik 80rem va 120rem oralig'ida bo'lganda */
}@frontend | Happy Coding
Please open Telegram to view this post
VIEW IN TELEGRAM
👍29🔥9
This media is not supported in your browser
VIEW IN TELEGRAM
#css #frontend
Faqat CSS orqali magnit havola effekti
li:has(a:is(:hover, :focus-visible)) {anchor-name: --a;}
ul::before {
left: anchor(--a left);
width: anchor-size(--a width);
}
CSS anchor position funksiyasidan foydalanib, indikator uchun hoverda anchor positionni belgilash
CSS Anchor Positioning — bu CSS-ning yangi imkoniyatlaridan biri bo‘lib, elementlarning joylashuvini boshqa elementlarga bog‘lashga yordam beradi.
@frontend | Happy Coding
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥14👍8
#css #update #frontend
Yangilanishlar veb dastruchilarga interaktiv foydalanuvchi interfeyslarini yaratishda yordam beradi. Quyida ushbu yangi xususiyatlarning ba'zilari va ularning kod misollari keltirilgan:
Matn kiritish maydonlarini matnning hajmiga qarab avtomatik ravishda o'lchash uchun field-sizing xususiyati qo'shildi.
```
textarea, select, input {
field-sizing: content;
}
```
Bu usul har qanday shrift, shrift o'lchami, til
va yozuv uslubi uchun mos.
interpolate-size xususiyati yordamida height: auto yoki boshqa kalit so'zlarga animatsiyalarni amalga oshirish mumkin.
```
:root {
interpolate-size: allow-keywords;
}
```
Bir nechta <details> elementlarini guruhlab, ularni o'zaro eksklyuziv qilish uchun name atributidan foydalanish mumkin.
```
<details name="learn-css">
<summary>CSSni o'rganish</summary>
<p>...</p>
</details>
<details name="learn-css">
<summary>Box Model</summary>
<p>...</p>
</details>
```
Bu usulda bir <details> elementi ochilganda, boshqa ochiq bo'lgan <details> elementi avtomatik ravishda yopiladi.
<details> va <summary> elementlariga display xususiyatini qo'llash va kengayib-yopiladigan qismni uslublash uchun ::details-content psevdosini ishlatish mumkin.
```
details {
display: flex;
flex-direction: row;
}
```
Elementlarni bir-biriga nisbatan joylashtirish uchun anchor asoslangan position joriy etildi.
```
.anchor {
anchor-name: --over-easy;
}
.positioned-element {
position: fixed;
position-anchor: --over-easy;
position-area: block-end;
}
```
Bu usul yordamida bir sahifadan boshqasiga o'tishda silliq o'tish effektlarini qo'shish osonlashadi.
```
@view-transition {
navigation: auto;
}
```
Skroll pozitsiyasiga bog'liq animatsiyalarni yaratish uchun skrollga asoslangan animatsiyalar API joriy etildi.
```
@keyframes appear {
from {
opacity: 0;
scale: 0.8;
}
to {
opacity: 1;
scale: 1;
}
}
img {
animation: appear linear;
animation-timeline: view();
animation-range: entry 25% cover 50%;
}
```💳 Skroll snap hodisalari
Usul yordamida skroll paytida foydalanuvchi interfeysining aniq joylariga o'tishni boshqarish osonlashadi.
```
scroller.addEventListener('scrollsnapchange', event => {
console.log(event.snapTargetBlock);
console.log(event.snapTargetInline);
});
```
light-dark() funksiyasi yordamida yorug'lik va qorong'ilik rejimlariga mos ranglarni belgilash mumkin.
```
:root {
color-scheme: light dark;
--primary-color: light-dark(#333, #fafafa);
--primary-background: light-dark(#e4e4e4, #121212);
--highlight-color: light-dark(hotpink, lime);
}
```
Boshqa yangilanishlar haqida misollar orqali tanishib chiqish
@frontend | Happy Coding
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥14👍9
This media is not supported in your browser
VIEW IN TELEGRAM
#animation #js #css #frontend
Kodlar izohda
@frontend | Happy Coding
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥17👍5
This media is not supported in your browser
VIEW IN TELEGRAM
#css #flexbox #frontend
React, TypeScript, Sass va Framer Motion texnologiyalari orqali ishlab chiqilgan.
Havola: demo
@frontend | Happy Coding
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥13👍2
#css #frontend
Endi SVG, rasm va animatsiyalarni bemalol qo‘llash mumkin.
Batafsil: Chrome for Developers
@frontend
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥24👍6
This media is not supported in your browser
VIEW IN TELEGRAM
#css #frontend
100vh – butun ko‘rinadigan viewport balandligini anglatadi (brauzerning address paneli va boshqa UI elementlari bilan birga)
100dvh – faol ishlayotgan viewport balandligini bildiradi - ya’ni foydalanuvchining ko‘ziga ayni paytda ko‘rinib turgan real ekran maydonini
Batafsil: havola
-----
100vh vs 100dvh — What’s the difference on mobile devices?
100vh – Represents the full visible viewport height, including the browser’s address bar and other UI elements.
100dvh – Represents the active viewport height — the actual screen space currently visible to the user.
Learn more: link
@frontend
Please open Telegram to view this post
VIEW IN TELEGRAM
1👍20 9
#animation #css #frontend
Endi hech qanday litsenziya cheklovisiz, barcha developerlar GSAP’ni loyihalarda bemalol ishlatishlari mumkin.
Batafsil: havola
-----
GSAP is now 100% free!
Now all developers can freely use GSAP in their projects with no license restrictions.
Learn more: link
@frontend
Please open Telegram to view this post
VIEW IN TELEGRAM
1👍24
#html #css #frontend
Endi ayrim JS, CSS kodlari va kutubxonalarsiz ham ko‘p ishlarni bajarish mumkin.
-----
Google I/O 2025: New HTML/CSS Features Introduced for Web Developers
Now, many tasks can be done without using extra JS, CSS code, or libraries.
- Popover API
- Anchor positioning API
- Anchor Tool
- Command Invokers
- Customizable Select Menus
- CSS Carousels
- Carousel configurator
- CSS scroll-state()
- Hovercards (Interest Invokers Explainer)
@frontend
Please open Telegram to view this post
VIEW IN TELEGRAM
1👍24
#nuxt #css #frontend
Nuxt 4 bilan yaratilgan loyihalarda dasturchilar orasida kichik muammo ya'ni style(css) fayllarni ulashda muammoga duch kelishmoqda. Yangiliklarni kuzatib bormagani uchunmi yoki AI'ga bog'lanib qolib docs/google search qilmaslik natijasida muammoni hal qilishlari uchun ko'p vaqt sarflab qo'yishmoqda.
Endi esa muammoga yechimcha berib ketsam.
Styles fayllarini noto‘g‘ri joyga joylashtirish va noto‘g‘ri yo‘l bilan import qilish orqali css'laringiz ishlamayotgan.
- Style fayllarni app/assets/ ichida saqlang
- nuxt.config.ts → css: ['~/assets/scss/main.scss']
Nuxt 4 da kodlaringiz “app/” papkasida bo'lishi kerak. Ya’ni barcha UI bilan bog‘liq papkalar: assets, components, composables, layouts, middleware, pages, plugins, utils — endi app/ ichida yozing.
“~” alias endi app/ ni ko'rsatadi
Batafsil docs: havola
@frontend
🔥8 4👍1
#css #tools #frontend
150+ bepul, zamonaviy fon patternlari va gradientlar to'plami bor ajoyib resurs. “live preview” va bitta click'da CSS/Tailwind kodini nusxalab olsangiz bo'ladi. Hero va card'lar uchun juda qulay.
-----
An awesome resource with a collection of 150+ free, modern background patterns and gradients. It offers a “live preview,” and you can copy the CSS/Tailwind code with one click. Super handy for hero sections and cards.
Link: https://patterncraft.fun
@frontend
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥11👍6 4
This media is not supported in your browser
VIEW IN TELEGRAM
#trend #css #frontend
To'liq kod: https://codepen.io/jh3y/pen/qEbYRVg
Siz ham loyihalarda sinab ko'rdingizmi?
@frontend
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥16👍5 5
This media is not supported in your browser
VIEW IN TELEGRAM
#css #ux #frontend
Oddiy CSS:
button[aria-label="Next slide"] {
cursor: url(chev-right.png), auto;
}
button[aria-label="Previous slide"] {
cursor: url(chev-left.png), auto;
}
@frontend
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥17👍5 2