使い方
- ボタンは、フォームや各コンテンツからの一覧・詳細画面への遷移などに利用できます。
- PC SPのサイズ、デザインパターンはクラスで定義されています。カスタムする場合はそれぞれのページに合わせたクラスで上書きをしてください。
- e-buttonWrapを使うと2つのボタンを横並びにできます。
画面表示
HTML/CSS(Sass)
<div>
<a href="#" class="e-button e-buttondesign">詳しくはこちら</a>
</div>
<div class="e-buttonWrap">
<a href="#" class="e-button e-buttondesign03">戻る</a>
<a href="#" class="e-button e-buttondesign04">次へ</a>
</div>
.e-button {
box-sizing: border-box;
margin: 0;
padding: 2rem;
text-decoration: none;
cursor: pointer;
display: inline-flex;
justify-content: center;
align-items: center;
transition: 0.5s;
}
@media screen and (min-width: 768px) {
.e-button {
width: 30.2rem;
height: 4.5rem;
font-size: 1.4rem;
}
}
@media screen and (max-width: 767px) {
.e-button {
width: 100%;
height: 10rem;
font-size: 3rem;
}
}
.e-buttonWrap {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 3rem;
}
.e-buttondesign {
background-color: #004da3;
color: #fff;
}
.e-buttondesign:hover {
background-color: #004da3;
color: #fff;
}
.e-buttondesign02 {
background-color: #009bac;
color: #fff;
}
.e-buttondesign02:hover {
background-color: #009bac;
color: #fff;
}
.e-buttondesign03 {
background-color: #fff;
border: solid 0.1rem #004da3;
color: #004da3;
}
.e-buttondesign03:hover {
background-color: #004da3;
color: #fff;
}
.e-buttondesign04 {
background-color: #fff;
border: solid 0.1rem #009bac;
color: #009bac;
}
.e-buttondesign04:hover {
background-color: #009bac;
color: #fff;
}
.e-submitdesign {
background-color: #004da3;
color: #fff;
padding: 1rem 1.5rem;
}
.e-submitdesign:hover {
background-color: #004da3;
color: #fff;
}
.e-submitdesign02 {
background-color: #009bac;
color: #fff;
padding: 1rem 1.5rem;
display: flex;
flex-direction: column;
min-height: 7rem;
}
.e-submitdesign02:hover {
background-color: #009bac;
color: #fff;
}
.e-submitdesign02_subText {
display: block;
font-size: 1.2rem;
}
.e-submitdesign02_mainText {
display: block;
font-size: 2.4rem;
letter-spacing: 0.2rem;
}
.e-arrow-left {
position: relative;
}
.e-arrow-left::before {
position: absolute;
top: 40%;
left: 1em;
content: "";
width: 0.7rem;
height: 0.7rem;
border-top: 0.2rem solid #fff;
border-right: 0.2rem solid #fff;
transform: rotate(45deg);
margin-right: 1rem;
}
.e-arrow-right {
position: relative;
}
.e-arrow-right::after {
position: absolute;
top: 40%;
right: 1em;
content: "";
width: 0.7rem;
height: 0.7rem;
border-top: 0.2rem solid #fff;
border-right: 0.2rem solid #fff;
transform: rotate(45deg);
margin-right: 1rem;
}
.e-arrow-outline-left {
position: relative;
}
.e-arrow-outline-left::before {
position: absolute;
top: 40%;
left: 1em;
content: "";
width: 0.7rem;
height: 0.7rem;
border-top: 0.2rem solid #004da3;
border-right: 0.2rem solid #004da3;
transform: rotate(45deg);
margin-right: 1rem;
}
.e-arrow-outline-left:hover::before {
border-top: 0.2rem solid #fff;
border-right: 0.2rem solid #fff;
}
.e-arrow-outline-right {
position: relative;
}
.e-arrow-outline-right::after {
position: absolute;
top: 40%;
right: 1em;
content: "";
width: 0.7rem;
height: 0.7rem;
border-top: 0.2rem solid #004da3;
border-right: 0.2rem solid #004da3;
transform: rotate(45deg);
margin-right: 1rem;
}
.e-arrow-outline-right:hover::after {
border-top: 0.2rem solid #fff;
border-right: 0.2rem solid #fff;
}
.e-arrow-outline-left02 {
position: relative;
}
.e-arrow-outline-left02::before {
position: absolute;
top: 40%;
left: 1em;
content: "";
width: 0.7rem;
height: 0.7rem;
border-top: 0.2rem solid #009bac;
border-right: 0.2rem solid #009bac;
transform: rotate(45deg);
margin-right: 1rem;
}
.e-arrow-outline-left02:hover::before {
border-top: 0.2rem solid #fff;
border-right: 0.2rem solid #fff;
}
.e-arrow-outline-right02 {
position: relative;
}
.e-arrow-outline-right02::after {
position: absolute;
top: 40%;
right: 1em;
content: "";
width: 0.7rem;
height: 0.7rem;
border-top: 0.2rem solid #009bac;
border-right: 0.2rem solid #009bac;
transform: rotate(45deg);
margin-right: 1rem;
}
.e-arrow-outline-right02:hover::after {
border-top: 0.2rem solid #fff;
border-right: 0.2rem solid #fff;
}
@media screen and (min-width: 768px) {
.e-sm-button {
width: 19.8rem;
height: 4.2rem;
}
}
@media screen and (max-width: 767px) {
.e-sm-button {
width: 39.6rem;
height: 7rem;
}
}
@media screen and (min-width: 768px) {
.e-lg-button {
width: 48.6rem;
height: 6rem;
}
}
@media screen and (max-width: 767px) {
.e-lg-button {
width: 100%;
height: 10rem;
}
}
@media screen and (min-width: 768px) {
.e-full-button {
width: 100%;
height: 6rem;
}
}
@media screen and (max-width: 767px) {
.e-full-button {
width: 100%;
height: 10rem;
}
}
@media screen and (min-width: 768px) {
.e-pcsm-button {
width: 19.8rem;
height: 4.2rem;
}
}
.e-left-button {
display: flex;
justify-content: flex-start;
}
.e-center-button {
display: flex;
justify-content: center;
}
.e-right-button {
display: flex;
justify-content: flex-end;
}
:disabled {
background-color: #ccc;
color: #666;
pointer-events: none;
}
/*
Component - Button + icon (Font Awesome6 Free)
------------------------------------------------- */
.e-before-icon-button {
position: relative;
display: inline-block;
padding: 0.2rem 0.3rem;
border: 0.1rem solid #004da3;
color: #004da3;
text-decoration: none;
transition: 0.25s;
}
.e-before-icon-button:focus,
.e-before-icon-button:hover {
background-color: #004da3;
color: #fff;
}
.e-before-icon-button::before {
display: inline-block;
margin-right: 0.5rem;
font-family: "Font Awesome 6 Free";
font-weight: 900;
}
.e-after-icon-button {
position: relative;
display: inline-block;
padding: 0.2rem 0.3rem;
border: 0.1rem solid #004da3;
color: #004da3;
text-decoration: none;
transition: 0.25s;
}
.e-after-icon-button:focus,
.e-after-icon-button:hover {
background-color: #004da3;
color: #fff;
}
.e-after-icon-button::after {
display: inline-block;
margin-right: 0.5rem;
font-family: "Font Awesome 6 Free";
font-weight: 900;
}
.e-button {
box-sizing: border-box;
margin: 0;
padding: 2.0rem;
text-decoration: none;
cursor: pointer;
display: inline-flex;
justify-content: center;
align-items: center;
transition: .5s;
//標準サイズ
@include mq(pc) {
width: 30.2rem;
height: 4.5rem;
font-size: 1.4rem;
}
@include mq(sp) {
width: 100%;
height: 10.0rem;
font-size: 3.0rem;
}
//2つのボタンを並べる場合のレイアウト用
&Wrap {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 3rem;
}
}
//primaryのカラーボタン
.e-buttondesign {
background-color: #004da3;
color: #fff;
&:hover {
background-color: #004da3;
color: #fff;
}
}
//secondaryのカラーボタン
.e-buttondesign02 {
background-color: #009bac;
color: #fff;
&:hover {
background-color: #009bac;
color: #fff;
}
}
//primary-outlineのカラーボタン
.e-buttondesign03 {
background-color: #fff;
border: solid 0.1rem #004da3;
color: #004da3;
&:hover {
background-color: #004da3;
color: #fff;
}
}
//secondary-outlineのカラーボタン
.e-buttondesign04 {
background-color: #fff;
border: solid 0.1rem #009bac;
color: #009bac;
&:hover {
background-color: #009bac;
color: #fff;
}
}
//送信ボタン デザイン
.e-submitdesign {
background-color: #004da3;
color: #fff;
padding: 1rem 1.5rem;
&:hover {
background-color: #004da3;
color: #fff;
}
}
//送信ボタン デザイン2
.e-submitdesign02 {
background-color: #009bac;
color: #fff;
padding: 1rem 1.5rem;
display: flex;
flex-direction: column;
min-height: 7rem;
&:hover {
background-color: #009bac;
color: #fff;
}
&_subText {
display: block;
font-size: 1.2rem;
}
&_mainText {
display: block;
font-size: 2.4rem;
letter-spacing: 0.2rem;
}
}
//左側に矢印を付与
.e-arrow-left {
position: relative;
&::before {
position: absolute;
top: 40%;
left: 1em;
content: '';
width: 0.7rem;
height: 0.7rem;
border-top: 0.2rem solid #fff;
border-right: 0.2rem solid #fff;
transform: rotate(45deg);
margin-right: 1rem;
}
}
//右側に矢印を付与
.e-arrow-right {
position: relative;
&::after {
position: absolute;
top: 40%;
right: 1em;
content: '';
width: 0.7rem;
height: 0.7rem;
border-top: 0.2rem solid #fff;
border-right: 0.2rem solid #fff;
transform: rotate(45deg);
margin-right: 1rem;
}
}
//左側に矢印を付与
.e-arrow-outline-left {
position: relative;
&::before {
position: absolute;
top: 40%;
left: 1em;
content: '';
width: 0.7rem;
height: 0.7rem;
border-top: 0.2rem solid #004da3;
border-right: 0.2rem solid #004da3;
transform: rotate(45deg);
margin-right: 1rem;
}
&:hover::before {
border-top: 0.2rem solid #fff;
border-right: 0.2rem solid #fff;
}
}
//右側に矢印を付与
.e-arrow-outline-right {
position: relative;
&::after {
position: absolute;
top: 40%;
right: 1em;
content: '';
width: 0.7rem;
height: 0.7rem;
border-top: 0.2rem solid #004da3;
border-right: 0.2rem solid #004da3;
transform: rotate(45deg);
margin-right: 1rem;
}
&:hover::after {
border-top: 0.2rem solid #fff;
border-right: 0.2rem solid #fff;
}
}
//左側に矢印を付与
.e-arrow-outline-left02 {
position: relative;
&::before {
position: absolute;
top: 40%;
left: 1em;
content: '';
width: 0.7rem;
height: 0.7rem;
border-top: 0.2rem solid #009bac;
border-right: 0.2rem solid #009bac;
transform: rotate(45deg);
margin-right: 1rem;
}
&:hover::before {
border-top: 0.2rem solid #fff;
border-right: 0.2rem solid #fff;
}
}
//右側に矢印を付与
.e-arrow-outline-right02 {
position: relative;
&::after {
position: absolute;
top: 40%;
right: 1em;
content: '';
width: 0.7rem;
height: 0.7rem;
border-top: 0.2rem solid #009bac;
border-right: 0.2rem solid #009bac;
transform: rotate(45deg);
margin-right: 1rem;
}
&:hover::after {
border-top: 0.2rem solid #fff;
border-right: 0.2rem solid #fff;
}
}
//ボタンサイズ
//small sm PC小 SP小
.e-sm-button {
@include mq(pc) {
width: 19.8rem;
height: 4.2rem;
}
@include mq(sp) {
width: 39.6rem;
height: 7rem;
}
}
//large lg PC大 SP最大幅
.e-lg-button {
@include mq(pc) {
width: 48.6rem;
height: 6rem;
}
@include mq(sp) {
width: 100%;
height: 10rem;
}
}
//full full PC最大幅 SP最大幅
.e-full-button {
@include mq(pc) {
width: 100%;
height: 6rem;
}
@include mq(sp) {
width: 100%;
height: 10rem;
}
}
//カスタム PCのみ小
.e-pcsm-button {
@include mq(pc) {
width: 19.8rem;
height: 4.2rem;
}
}
//ボタン位置(親要素に指定)
//左
.e-left-button {
display: flex;
justify-content: flex-start;
}
//中央
.e-center-button {
display: flex;
justify-content: center;
}
//右
.e-right-button {
display: flex;
justify-content: flex-end;
}
//クリックできない状態
:disabled {
background-color: #ccc;
color: #666;
pointer-events : none;
}
/*
Component - Button + icon (Font Awesome6 Free)
------------------------------------------------- */
//アイコン付きのボタン(アイコン前)
.e-before-icon-button {
position: relative;
display: inline-block;
padding: .2rem .3rem;
border: 0.1rem solid #004da3;
color: #004da3;
text-decoration: none;
transition: .25s;
}
.e-before-icon-button:focus,
.e-before-icon-button:hover {
background-color: #004da3;
color: #fff;
}
.e-before-icon-button::before {
display: inline-block;
margin-right: .5rem;
font-family: "Font Awesome 6 Free";
font-weight: 900;
}
// .e-before-icon-button-download::before {
// content: '\f019';
// }
//アイコン付きのボタン(アイコン後)
.e-after-icon-button {
position: relative;
display: inline-block;
padding: .2rem .3rem;
border: 0.1rem solid #004da3;
color: #004da3;
text-decoration: none;
transition: .25s;
}
.e-after-icon-button:focus,
.e-after-icon-button:hover {
background-color: #004da3;
color: #fff;
}
.e-after-icon-button::after {
display: inline-block;
margin-right: .5rem;
font-family: "Font Awesome 6 Free";
font-weight: 900;
}
// .e-after-icon-button-link::after {
// content: '\f35d';
// }