-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Поле ввода | ||
|
||
figma: [https://www.figma.com/file/LavZmQfQccqyrTMzoSJYNu/CSS-Course?node-id=18342%3A1](https://www.figma.com/file/LavZmQfQccqyrTMzoSJYNu/CSS-Course?node-id=18342%3A1) | ||
|
||
Самое обычное - `input type="text"`. | ||
|
||
Не забудьте учесть состояния: | ||
- `:focus` | ||
- `_invalid` | ||
- `_success` | ||
- `_success:focus` | ||
- `_invalid:focus` | ||
|
||
Для `_success` и `_invalid` используем БЭМ-модификаторы, а не их CSS-братья `:valid` и `:invalid`, так как возможности CSS в данном случае не так велики, как JS. Если в форме регистрации придет ошибка, что такой email уже зарегистрирован, то нужно уметь выставить состояние `invalid` через JS. Также не всегда момент валидации через CSS совпадает с желаемым моментом валидации поля по дизайну. | ||
|
||
В общем случае можно сделать `input` недоступным для ввода через `:disabled`. | ||
Можно предусмотреть и это состояние - задание по желанию, со звездочкой :D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<!-- Страница с полем ввода --> | ||
<html lang="ru"> | ||
<head> | ||
<link rel="stylesheet" href="../../assets/css/main.css"> | ||
<link rel="stylesheet" href="./input.css"> | ||
</head> | ||
<body> | ||
|
||
</body> | ||
</html> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const expect = require('chai').expect; | ||
|
||
describe('lection5/input', () => { | ||
it('Поле ввода', () => { | ||
expect(1).to.equal(1); | ||
}); | ||
}); |