サイト内検索
詳細ボックスの折りたたみの文字が逆さまになる | カスタマイズ相談 | Cocoon フォーラム

Topic starter2021年1月5日 13:37
先日は雑談での詳細ボックスの情報を頂きましてCSSを参考にして、Font Awesomeの読み込みとバージョン5から指定が変わりこちらも変更してアイコンも表示ができたのですが、詳細文字がクリックすると文字が逆さまになり、これを【閉じる】に変更と文字を通常状態にするにはどうしたらいいのでしょうか?
お手数ですがどうぞよろしくお願い致します。
URL
CSS
/* ============================== *
* 詳細折りたたみボックス
* ============================== */
.details-wrap {
position: relative;
}
.details-content {
max-height: 150px;
overflow: hidden;
transition: 0.3s;
}
.details-content:after {
content: "";
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 80%);
width: 100%;
height: 100px;
display: block;
position: absolute;
bottom: 0;
left: 0;
pointer-events: none;
}
.details-checkbox {
display: none;
}
.details-button {
height: 45px;
width: 100%;
border-width: 4px;
border-style: none none double;
border-color: rgba(104, 166, 197, 0.5);
cursor: pointer;
position: absolute;
bottom: 0;
z-index: 1;
overflow: hidden;
text-align: center;
}
.details-button:before {
font-size: 30px;
height: 45px;
line-height: 1;
content: '\f139 詳細';
color: #68a6c5;
text-shadow: 0 0 10px #fff;
font-family: "Font Awesome 5 Free";
display: block;
margin: 0 0 1em;
opacity: 0.5;
font-weight: 900;
}
.details-button:hover:before {
opacity: 0.8;
}
.details-checkbox:checked ~ .details-content {
max-height: none;
padding-bottom: 40px;
}
.details-checkbox:checked ~ .details-button {
border-bottom: none;
border-top-style: double;
}
.details-checkbox:checked ~ .details-button:before {
transform: rotate(180deg);
}
.details-checkbox:checked ~ .details-content:after {
display: none;
}
/* -------------------------------
* クラシックエディタを使っていて
* 勝手に段落が追加される(変な余白が出る)場合
* ------------------------------- */
.details-wrap p:empty {
display: none;
}