FRONTEND_1 Telegram 3953
🔥 Трюк с :has() в CSS — как маленький хак улучшает UX

Селектор :has() поддерживается во всех современных браузерах. Его часто называют «селектором родителя», но он куда мощнее.

Вот пример, как улучшить UX форм без JS 👇


form:has(input:invalid) button[type="submit"] {
opacity: 0.5;
pointer-events: none;
}


📌 Что делает:
Если в форме есть невалидный input, сабмит-кнопка становится неактивной.

💡 Применения :has():
- Показывать/прятать элементы в зависимости от вложенности;
- Делать UI реактивным без JS;
- Улучшать доступность форм и состояний.

Минимализм, UX и современный CSS — в одном трюке. Попробуй!

👉 @frontend_1
👍132



tgoop.com/frontend_1/3953
Create:
Last Update:

🔥 Трюк с :has() в CSS — как маленький хак улучшает UX

Селектор :has() поддерживается во всех современных браузерах. Его часто называют «селектором родителя», но он куда мощнее.

Вот пример, как улучшить UX форм без JS 👇


form:has(input:invalid) button[type="submit"] {
opacity: 0.5;
pointer-events: none;
}


📌 Что делает:
Если в форме есть невалидный input, сабмит-кнопка становится неактивной.

💡 Применения :has():
- Показывать/прятать элементы в зависимости от вложенности;
- Делать UI реактивным без JS;
- Улучшать доступность форм и состояний.

Минимализм, UX и современный CSS — в одном трюке. Попробуй!

👉 @frontend_1

BY Frontend разработчик




Share with your friend now:
tgoop.com/frontend_1/3953

View MORE
Open in Telegram


Telegram News

Date: |

Telegram message that reads: "Bear Market Screaming Therapy Group. You are only allowed to send screaming voice notes. Everything else = BAN. Text pics, videos, stickers, gif = BAN. Anything other than screaming = BAN. You think you are smart = BAN. Write your hashtags in the language of your target audience. Deputy District Judge Peter Hui sentenced computer technician Ng Man-ho on Thursday, a month after the 27-year-old, who ran a Telegram group called SUCK Channel, was found guilty of seven charges of conspiring to incite others to commit illegal acts during the 2019 extradition bill protests and subsequent months. The public channel had more than 109,000 subscribers, Judge Hui said. Ng had the power to remove or amend the messages in the channel, but he “allowed them to exist.” It’s easy to create a Telegram channel via desktop app or mobile app (for Android and iOS):
from us


Telegram Frontend разработчик
FROM American