/*ex 아래처럼 종속되게 하지 않는다.*/
#main .warning {
background-color: azure;
color: blue;
}
/*base : font-familly, font-size, reset 등*/
*{
font-size: 10px;
}
/*layout : header, main, footer 등 */
header{
~
}
/*module : 레이아웃 안에서 배치되는 모든 요소들, 모양이 조금 다르면 서브클래스를 만든다.*/
.btn{
...
}
.btn-small{
...
}
.btn-big{
...
}
/*state : 모듈과 비슷하지만 차이는 자바스크립트에 종속된다는 점이다.*/
.is-active {
background-color: blanchedalmond;
}
.is-active a {
pointer-events: none;
color: red;
}
/*theme : 사용자에게 사이트의 느낌을 전달하는 이미지, 색상 등을 의미한다.*/
피그마를 보고 클론하는 실습이다. 옆에 js를 이용하여 유효성 검사하는 페이지는 아직 진도가 안나갔으니 제외했다.
크게 다음과 같이 구분했다.
<body>
<main>
<section><h1>로그인 또는 회원가입</h1></section>
<section>
<h2>위니브에서 여러분의 궁금증을 해결하세요!:)</h2>
<div>
<form action="#">
<input type="text" placeholder="아이디" />
<input type="password" placeholder="비밀번호" />
<input type="checkbox" />
<button type="submit">로그인</button>
</form>
</div>
<div>
<p>회원가입</p>
<p>아이디/비밀번호 찾기</p>
</div>
</section>
<section>
<div><p>또는</p></div>
<div>
<img src="./source/images/Google__G__Logo 1.png" alt="google-logo" />
구글 계정으로 로그인
</div>
<div>
<img src="./source/images/facebook.png" alt="facebook-logo" />
페이스북 계정으로 로그인
</div>
<div>
<img src="./source/images/naver-logo.png" alt="naver-logo" />
네이버 계정으로 로그인
</div>
<div>
<img src="./source/images/message-circle.png" alt="kakao-logo" />
카카오 계정으로 로그인
</div>
</section>
</main>
</body>
<input id = "cb" type="checkbox" />
<label for="cb"></label>
<p>로그인 상태 유지</p>
input[id="cb"] {
display: none;
}
input[id="cb"] + label {
display: inline-block;
background: center no-repeat url(../images/check.png);
margin: 6px 8px 0 28px;
width: 22px;
height: 22px;
border: 1px solid #767676;
border-radius: 50%;
cursor: pointer;
}
input[id="cb"]:checked + label {
background: center no-repeat url(../images/checked.png);
background-color: #2f80ed;
border: 1px solid #2f80ed;
}
처음에는 css 설계기법을 이용하여 정리하면서 하고있었는데 진행할수록 점점 정리가 엉망이 되었다. 또한 이렇게 간단한 ui를 따라만드는 것도 3시간 정도가 걸렸다. 더 열심히 해야겠다고 생각했다.