Skip to content

Instantly share code, notes, and snippets.

@jerinisready
Last active November 29, 2018 11:55
Show Gist options
  • Select an option

  • Save jerinisready/d324f80900daf0053e17cd4c57987de7 to your computer and use it in GitHub Desktop.

Select an option

Save jerinisready/d324f80900daf0053e17cd4c57987de7 to your computer and use it in GitHub Desktop.
Css Snippet to have a Medium / Linkedin like, TextArea which is borderless, paddingless, title like, word break automatically to new line, overflow managed!
textarea {
overflow-wrap: break-word;
-webkit-appearance: textarea;
border: none;
-webkit-rtl-ordering: logical;
-webkit-user-select: text;
-webkit-box-orient: vertical;
background: transparent none repeat scroll 0 0 !important;
z-index: auto;
resize: vertical;
cursor: auto;
padding: 0;
white-space: pre-wrap;
word-wrap: break-word;
width: 100%;
min-height: 1em;
transition: none 0s cubic-bezier(.67,.19,.25,1) 0s;
outline: 0;
}
textarea.title {
font-size: 42px;
font-weight: 600;
}
textarea.title::placeholder,
textarea.title::-webkit-input-placeholder,
textarea.title::-moz-placeholder,
textarea.title::-ms-input-placeholder,
textarea.title::-moz-placeholder{
font-size: 42px;
font-weight: 600;
}
/**
placeholder{ }
-webkit-input-placeholder { }
story__title > textarea::-moz-placeholder { }
story__title > textarea:-ms-input-placeholder { }
story__title > textarea:-moz-placeholder { }
**/
/* Courtsy :
1) https://stackoverflow.com/a/14841923
2) https://developer.mozilla.org/en-US/docs/Web/CSS/word-break
*/
/**
Usage:
<textarea class="title" placeholder="">
</textarea>
**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment