Skip to content

Instantly share code, notes, and snippets.

View don1138's full-sized avatar
🐝

Don Schnitzius don1138

🐝
View GitHub Profile
/* This parent can be any width and height */
.block {
text-align: center;
/* May want to do this if there is risk the container may be narrower than the element inside */
white-space: nowrap;
}
/* The ghost, nudged to maintain perfect centering */
.block:before {
/* via "Operating systems default sans-serif fonts" (https://fontsarena.com/blog/operating-systems-default-sans-serif-fonts) */
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Oxygen, Cantarell, sans-serif;
/* System Fonts as used by GitHub */
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
/* System Fonts as used by Medium and WordPress */
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
@don1138
don1138 / webkit-only.css
Created September 5, 2016 10:12
Hack for Webkit
@media all and (-webkit-min-device-pixel-ratio: 1){
selectors {
properties: values;
}
}
@media screen and (min-width: 720px) {
.table {
display: table;
width: 100%;
border-collapse: collapse;
}
}
.tr {
margin-bottom: 1.6rem;
h1 a , h2 a , h3 a , h4 a , h5 a , h6 a {
color:inherit;
opacity:1;
}
h1 a:hover , h2 a:hover , h3 a:hover , h4 a:hover , h5 a:hover, h6 a:hover{
color:inherit;
opacity:0.8;
}
/* CSS3 recognizes several media types, including print, handheld, and screen. iOS ignores print and handheld media queries because these types do not supply high-end web content. Therefore, use the screen media type query for iOS. */
/* To specify a style sheet that is just for iOS without affecting other devices, use the only keyword in combination with the screen keyword in your HTML file. Older browsers ignore the only keyword and won’t read your iOS style sheet. Use max-device-width, and min-device-width to describe the screen size. */
/* For example, to specify a style sheet for iPhone and iPod touch, use an expression similar to the following: */
<link media="only screen and (max-device-width: 480px)" href="small-device.css" type= "text/css" rel="stylesheet">
/* To specify a style sheet for devices other than iOS, use an expression similar to the following: */
<link media="screen and (min-device-width: 481px)" href="not-small-device.css" type="text/css" rel="stylesheet">
/* To load styles intend
pre {
background: #e4e4e4;
font-family: Consolas, "Liberation Mono", Courier, monospace;
font-weight: bold;
padding: 22px;
color: #777;
font-size: 14px;
line-height:1.32;
margin-bottom: 22px;
max-width: 100%;
img {
max-width: 100%;
height: auto;
image-rendering: optimizeQuality;
}
body {
/* The Browser makes its best guess with its own rendering engine */
/* results will vary based on the browser */
text-rendering: auto;
/* The Browser chooses page speed over font calculations and legibility */
text-rendering: optimizeSpeed;
/* The Browser chooses legibility over font calculations and page speed */
text-rendering: optimizeLegibility;
@don1138
don1138 / text-breakouts.css
Created June 11, 2013 22:10
CSS Prevent Text Breakouts
.prevent-text-breakouts {
-ms-word-break: break-all;
word-break: break-all;
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}