Skip to content

Instantly share code, notes, and snippets.

@kennasoft
Created October 14, 2017 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennasoft/d4f8594f7a06751b73dfb6a6cf4390ed to your computer and use it in GitHub Desktop.
Save kennasoft/d4f8594f7a06751b73dfb6a6cf4390ed to your computer and use it in GitHub Desktop.
CSS for adding a rudimentary console to jsfiddle
footer,
footer *,
footer *:before,
footer *:after {
box-sizing: border-box;
}
.console {
background: black;
width: 100%;
position: absolute;
bottom: 0;
min-height: 100%;
font-family: monospace;
overflow-y: scroll;
}
.console-log {
color: white;
}
.console-error {
color: red;
}
#console-toggle {
width: 100%;
background: #ddd;
position: absolute;
height: 0;
bottom: 0;
transition: height .1s linear;
}
#console-toggle::before {
content: ' ';
width: 100%;
position: absolute;
top: -5px;
height: 5px;
padding: 5px;
background: #ddd;
}
#console-toggle::after {
content: 'console';
font-weight: bold;
color: red;
padding: 5px 10px;
text-align: center;
font-family: monospace;
border-radius: 5px 5px 0 0;
width: auto;
height: 15px;
position: absolute;
right: 15px;
top: -25px;
background: #ddd;
cursor: pointer;
}
#console-toggle.open {
height: 75%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment