Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 스크롤 이벤트 감지
- 검색
- formgroup
- modal
- Angular Router
- angular modal
- summary
- 셀렉트박스 커스텀
- 모달
- angular route
- ApexChart
- angular animation
- 앵귤러 모달
- 아이오닉 스크롤 이벤트
- 호버
- prisma
- flex-1
- 옵저버블
- Ionic modal
- angular button
- egov spring ajax 사용 예시
- 앵귤러 애니메이션
- ajax 사용 예시
- route
- Router
- scroll
- TAILWIND
- Oracle LISTAGG 사용 예시
- 스크롤 이벤트
- mysql if
Archives
- Today
- Total
깜놀하는 해므찌로
Tailwind Angular 토글 CSS 예시 본문
반응형
SMALL
<div
[ngClass]="{
'bg-primary after:top-0 after:left-6 peer-checked:after:translate-x-1/5': boolean,
' after:top-0 after:right-6 bg-gray-100': !boolean
}"
class="w-11 h-6 peer-focus:outline-none rounded-full peer bg-gray-100 dark:bg-gray-100 peer-checked:after:border-gray-200 after:content-[''] after:absolute after:top-[0px] after:left-[0px] after:bg-white after:border-gray-200 after:border after:rounded-full after:h-6 after:w-6 dark:border-gray-300 after:transition-all"
></div>
1. peer-checked: 토글 버튼을 선택하는 순간 무조건 발동되므로, boolean 으로 조절
2. !boolean: 부분에는 peer-checked:after:translate 자리이동 하는 속성을 빼서 boolean 값이 false인 경우 그냥 자리에 그대로 있음
반응형
LIST
'IT' 카테고리의 다른 글
warning: in the working copy of 'yarn.lock', LF will be replaced by CRLF the next time Git touches it 에러 해결 예시 (0) | 2023.04.29 |
---|---|
C언어 포인터 기초 설명 예시 (0) | 2023.04.29 |
C언어 배열 팁 (0) | 2023.04.28 |
tailwind hover 호버 이벤트 ring / 호버 시 테두리 (0) | 2023.04.28 |
Angular 사업자 번호 input 컴포넌트 예시 / 사업자 번호 정규식 (0) | 2023.04.28 |