mirror of
https://github.com/seigler/seigler.github.io
synced 2025-07-27 07:16:09 +00:00
🎉 add primitive print stylesheet
This commit is contained in:
parent
55b578498c
commit
b69a407186
13 changed files with 196 additions and 9 deletions
1
.publish
Submodule
1
.publish
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 745977500581f866ec8b9d3d8df5a8af22d4cf71
|
|
@ -63,16 +63,13 @@ var onError = function (error, task) {
|
|||
};
|
||||
|
||||
gulp.task('clean:less', function () {
|
||||
return gulp.src([
|
||||
paths.dest_css + 'bundle.css',
|
||||
paths.dest_css + 'bundle.css.map'
|
||||
], {read: false})
|
||||
return gulp.src([ paths.dest_css + 'bundle*' ], {read: false})
|
||||
.pipe(clean());
|
||||
});
|
||||
|
||||
// Compile LESS to CSS
|
||||
gulp.task('build:less', function () {
|
||||
return gulp.src(paths.src_less + 'bundle.less')
|
||||
return gulp.src(paths.src_less + 'bundle*.less')
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(plumber({
|
||||
errorHandler: function (error) { onError(error, 'LESS'); }
|
||||
|
@ -84,7 +81,6 @@ gulp.task('build:less', function () {
|
|||
browsers: ['last 2 versions'],
|
||||
cascade: false
|
||||
}))
|
||||
.pipe(rename('bundle.css'))
|
||||
.pipe(sourcemaps.write('./'))
|
||||
.pipe(gulp.dest(paths.dest_css)); // path to css directory
|
||||
});
|
||||
|
|
|
@ -11,4 +11,8 @@ Afterwards, static assets are revision-hashed, and markup is reformatted.
|
|||
|
||||
## The Rest of the Stuff
|
||||
|
||||
I wanted to write the site styles in LESS, my favorite CSS preprocessor. I used the node LESS compiler with Gulp, the trendiest available task runner. (Kidding, I like Gulp. File streams are a neat idea and worked great for me on this project.) I also really wanted to build an SVG sprite from files included in the theme. To do that, I used `gulp-svgstore`. Just out-of-the-box it worked great.
|
||||
I wanted to write the site styles in LESS, my favorite CSS preprocessor. I used the node LESS compiler with Gulp, the trendiest available task runner. (Kidding, I like Gulp. File streams are a neat idea and worked great for me on this project.)
|
||||
|
||||
## Styles
|
||||
|
||||
This design in particular was a pain to get right. I had to find the right perspective and transform settings to distort the screen just right, even when the document was resized. I learned that the `<body>` tag ignores most `transform` properties, so there isn't a way to have the page scroll _with perspective_ and keep the scrollbar in the normal place on the right edge of the viewport.
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
{{ .Title }} - {{ .Site.Title }}
|
||||
{{ end }}</title>
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
<link rel="stylesheet" href="css/bundle.css">
|
||||
<link rel="stylesheet" href="css/bundle-screen.css" media="not print">
|
||||
<link rel="stylesheet" href="css/bundle-print.css" media="print">
|
||||
</head>
|
||||
|
||||
<body class="{{ .Section | default .Title | urlize }}">
|
||||
|
|
13
src/themes/eos/static/css/bundle-print.css
Normal file
13
src/themes/eos/static/css/bundle-print.css
Normal file
|
@ -0,0 +1,13 @@
|
|||
* {
|
||||
font-family: inherit;
|
||||
}
|
||||
html {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
code,
|
||||
pre,
|
||||
kbd {
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=bundle-print.css.map */
|
1
src/themes/eos/static/css/bundle-print.css.map
Normal file
1
src/themes/eos/static/css/bundle-print.css.map
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["bundle-print.less","bundle-print.css"],"names":[],"mappings":"AAAA;EACE,qBAAA;CCCD;ADED;EACE,wBAAA;CCAD;ADGD;;;EACE,uBAAA;CCCD","file":"bundle-print.css","sourcesContent":["* {\n font-family: inherit;\n}\n\nhtml {\n font-family: sans-serif;\n}\n\ncode, pre, kbd {\n font-family: monospace;\n}\n","* {\n font-family: inherit;\n}\nhtml {\n font-family: sans-serif;\n}\ncode,\npre,\nkbd {\n font-family: monospace;\n}\n"]}
|
152
src/themes/eos/static/css/bundle-screen.css
Normal file
152
src/themes/eos/static/css/bundle-screen.css
Normal file
|
@ -0,0 +1,152 @@
|
|||
/* micro styles reset */
|
||||
*,
|
||||
:before,
|
||||
:after {
|
||||
box-sizing: inherit;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
transform-style: preserve-3d;
|
||||
font-family: inherit;
|
||||
}
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
color: white;
|
||||
text-shadow: 0 0 0.1em rgba(255, 255, 255, 0.5);
|
||||
line-height: 1.2;
|
||||
}
|
||||
a {
|
||||
color: inherit;
|
||||
}
|
||||
a:hover,
|
||||
a:focus {
|
||||
background-color: white;
|
||||
color: #20282a;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
::-moz-selection {
|
||||
background-color: white;
|
||||
color: #20282a;
|
||||
}
|
||||
::selection {
|
||||
background-color: white;
|
||||
color: #20282a;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4 {
|
||||
font-size: inherit;
|
||||
font-weight: bold;
|
||||
border-bottom: 0.1em dotted;
|
||||
margin-bottom: -0.1em;
|
||||
margin-top: 1em;
|
||||
}
|
||||
h2 {
|
||||
border-bottom: none;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
header {
|
||||
background-color: white;
|
||||
color: #20282a;
|
||||
}
|
||||
header nav a {
|
||||
text-decoration: none;
|
||||
}
|
||||
header nav a:hover,
|
||||
header nav a:focus,
|
||||
header nav a.active {
|
||||
color: white;
|
||||
background-color: #20282a;
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 1px #20282a;
|
||||
}
|
||||
header nav a:before {
|
||||
content: '[';
|
||||
}
|
||||
header nav a:after {
|
||||
content: ']';
|
||||
}
|
||||
footer {
|
||||
border-top: 0.1em dotted;
|
||||
}
|
||||
code {
|
||||
background-color: rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
/*layout*/
|
||||
html {
|
||||
font-size: calc(0.8em + 1.3vmin);
|
||||
height: 100%;
|
||||
}
|
||||
body {
|
||||
background-image: url(../img/workstation.jpg), url(../img/gradient.jpg);
|
||||
background-size: 100% auto, auto 133.3vmin;
|
||||
background-position: 100% 0%;
|
||||
background-repeat: no-repeat, repeat-x;
|
||||
background-color: white;
|
||||
height: 100%;
|
||||
font-family: monospace;
|
||||
perspective: 68vw;
|
||||
perspective-origin: 69vw 45vw;
|
||||
}
|
||||
.wrapper {
|
||||
position: relative;
|
||||
transform: rotateZ(1.3deg) rotateX(-8.8deg) rotateY(-9.3deg) scale(0.3) translate3d(-56.2vw, 86.1vw, 46.3vw);
|
||||
transform-origin: top right;
|
||||
padding: 1vw;
|
||||
height: 75vw;
|
||||
width: 100vw;
|
||||
margin: 0 0 0 auto;
|
||||
overflow: auto;
|
||||
perspective: none;
|
||||
}
|
||||
.wrapper > *,
|
||||
.wrapper:before,
|
||||
.wrapper:after {
|
||||
opacity: 0.8;
|
||||
transform: translateZ(-50vmin);
|
||||
}
|
||||
@media (min-width: 100vh) {
|
||||
body {
|
||||
background-size: auto 133.3vh, auto 133vh;
|
||||
background-position: 100% 0%;
|
||||
perspective: 68vh;
|
||||
perspective-origin: calc(100vw - 31vh) 45vh;
|
||||
}
|
||||
.wrapper {
|
||||
transform: rotateZ(1.3deg) rotateX(-8.8deg) rotateY(-9.3deg) scale(0.3) translate3d(-56.2vh, 86.1vh, 46.3vh);
|
||||
transform-origin: top right;
|
||||
padding: 1vh;
|
||||
width: 100vh;
|
||||
height: 75vh;
|
||||
}
|
||||
}
|
||||
.wrapper {
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
-ms-flex-pack: start;
|
||||
justify-content: flex-start;
|
||||
-ms-flex-line-pack: stretch;
|
||||
align-content: stretch;
|
||||
}
|
||||
main {
|
||||
margin: 1em 0;
|
||||
-ms-flex-positive: 1;
|
||||
flex-grow: 1;
|
||||
}
|
||||
.post-list a {
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.post-list .title {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/*# sourceMappingURL=bundle-screen.css.map */
|
1
src/themes/eos/static/css/bundle-screen.css.map
Normal file
1
src/themes/eos/static/css/bundle-screen.css.map
Normal file
File diff suppressed because one or more lines are too long
|
@ -72,6 +72,9 @@ header nav a:after {
|
|||
footer {
|
||||
border-top: 0.1em dotted;
|
||||
}
|
||||
code {
|
||||
background-color: rgba(255, 255, 255, 0.15);
|
||||
}
|
||||
/*layout*/
|
||||
html {
|
||||
font-size: calc(0.8em + 1.3vmin);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -65,3 +65,7 @@ header {
|
|||
footer {
|
||||
border-top: 0.1em dotted;
|
||||
}
|
||||
|
||||
code {
|
||||
background-color: fade(@color-text, 15%);
|
||||
}
|
||||
|
|
11
src/themes/eos/styles/bundle-print.less
Normal file
11
src/themes/eos/styles/bundle-print.less
Normal file
|
@ -0,0 +1,11 @@
|
|||
* {
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
code, pre, kbd {
|
||||
font-family: monospace;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue