Skip to content

Instantly share code, notes, and snippets.

@yasinkuyu
Last active August 29, 2015 14:03
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 yasinkuyu/9eefb41d1c0704513473 to your computer and use it in GitHub Desktop.
Save yasinkuyu/9eefb41d1c0704513473 to your computer and use it in GitHub Desktop.
CSS/HTML/JS Units of Measure Parsing
/*
@ CSS/HTML/JS Units of Measure Parsing
@ Regular Expressions (RegEx / RegExp) Pattern
@ Test http://www.regexr.com/39424
@ Pattern RegExp(/(\d*\.?\d+)\s?(px|em|ex|%|in|cm|mm|pt|pc+)/igm)
Yasin Kuyu - twitter.com/yasinkuyu */
#Comments
/*
Comment test .00000001em
*/
<!-- solid 1px #ccc -->
#Html
<div style="width:500px"></div>
<p> This inline units test sample value 600%</P>
<div>
+12.34em
.15 px
.50000%
</div>
#Javascript
"1px",
"1.px",
"11.px",
"11.1px",
"11.11px",
"1.11px",
".11px",
".1px",
#CSS
.color-editor {
font-size: 12px;
min-width: -450px;
height: 190px;
top: .0em;
padding: 16px 16px 14px 46px;
}
450px
.color-editor:focus {
outline: none;
}
.color-editor aside {
display: inline-block;
position: relative;
height: 100%;
overflow: visible;
margin-left: 6px;
vertical-align: top;
}
.color-editor aside header {
width: 100%;
overflow: hidden;
margin-bottom: 10px;
}
.color-editor aside header .large-swatches {
border-radius: 3px;
background-size: 8px;
height: 35px;
width: 88px;
margin-right: 9px;
display: inline-block;
box-shadow: 0 1px 0 #fff;
position: relative;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment