From 92e892cb5b6baba7988187c663e400629f9ce5b2 Mon Sep 17 00:00:00 2001 From: Ayush Kumar <131751122+Ayush277@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:21:47 +0530 Subject: [PATCH] Update style.css --- CSS Toggle/style.css | 154 +++++++++++++++++++++---------------------- 1 file changed, 74 insertions(+), 80 deletions(-) diff --git a/CSS Toggle/style.css b/CSS Toggle/style.css index 7550e56e..4bff871f 100644 --- a/CSS Toggle/style.css +++ b/CSS Toggle/style.css @@ -1,91 +1,85 @@ * { - margin:0; - padding:0; - font-family:"Helvetica Neue", Helvetica, Sans-serif; - word-spacing:-2px; - } - - h1 { - font-size:40px; - font-weight:bold; - color:#191919; - -webkit-font-smoothing: antialiased; - } - - h2 { - font-weight:normal; - font-size:20px; - color:#888; - padding:5px 0; - } - - .message { - background:#181818; - color:#FFF; + margin: 0; + padding: 0; + font-family: "Helvetica Neue", Helvetica, Sans-serif; + word-spacing: -2px; + box-sizing: border-box; +} + +h1 { + font-size: 40px; + font-weight: bold; + color: #191919; + -webkit-font-smoothing: antialiased; +} + +h2 { + font-weight: normal; + font-size: 20px; + color: #888; + padding: 5px 0; +} + +.message, #toggle + label { position: absolute; + cursor: pointer; + transition: all 300ms cubic-bezier(0.17, 0.04, 0.03, 0.94); +} + +.message { + background: #181818; + color: #FFF; top: -250px; left: 0; width: 100%; height: 250px; padding: 20px; - transition: top 300ms cubic-bezier(0.17, 0.04, 0.03, 0.94); overflow: hidden; - box-sizing: border-box; - - } - - .message h1 { - color:#FFF; - } - - #toggle { - position:absolute; - appearance:none; - cursor:pointer; - left:-100%; - top:-100%; - } - - #toggle + label { - position:absolute; - cursor:pointer; - padding:10px; - background: #26ae90; - width: 100px; - border-radius: 3px; +} + +.message h1 { + color: #FFF; +} + +#toggle { + appearance: none; + position: absolute; + left: -100%; + top: -100%; +} + +#toggle + label { padding: 8px 10px; + background: #26ae90; color: #FFF; - line-height:20px; - font-size:12px; - text-align:center; - -webkit-font-smoothing: antialiased; - cursor: pointer; - margin:20px 50px; - transition:all 500ms ease; - } - #toggle + label:after { - content:"Open" - } - - .container { + font-size: 12px; + text-align: center; + border-radius: 3px; + margin: 20px 50px; + line-height: 20px; +} + +#toggle + label:after { + content: "Open"; +} + +.container { transition: margin 300ms cubic-bezier(0.17, 0.04, 0.03, 0.94); - padding:5em 3em; - } - - #toggle:checked ~ .message { - top: 0; - } - - #toggle:checked ~ .container { - margin-top: 250px; - } - - #toggle:checked + label { - background:#dd6149; - } - - #toggle:checked + label:after { - content:"Close" - } - - \ No newline at end of file + padding: 5em 3em; +} + +#toggle:checked ~ .message { + top: 0; +} + +#toggle:checked ~ .container { + margin-top: 250px; +} + +#toggle:checked + label { + background: #dd6149; +} + +#toggle:checked + label:after { + content: "Close"; +}