Browse Source

- Changed CSS: using GitHub's primer CSS theme.

- Cleanup.
- Updated two posts.
- Updated readme.
dev
Franco Masotti 4 weeks ago
parent
commit
2ecb870d8e
Signed by: frnmst
GPG Key ID: 24116ED85666780A
  1. 35
      README.md
  2. 1
      _assets/badge-powered_by_jekyll.svg
  3. 1
      _assets/badge-uses_html5.svg
  4. 1
      _assets/badge-uses_minimal_css.svg
  5. 3
      _assets/core.scss
  6. 7
      _includes/footer.html
  7. 2
      _layouts/default.html
  8. 1
      _layouts/post.html
  9. 5
      _posts/2020-02-06-what-happened-to-the-css.md
  10. 4
      _posts/2021-02-21-an-alternative-to-github-pages.md
  11. 6
      _sass/jekyll-theme-primer.scss
  12. 28
      _sass/main.scss
  13. 5
      _sass/primer-base/index.scss
  14. 84
      _sass/primer-base/lib/base.scss
  15. 423
      _sass/primer-base/lib/normalize.scss
  16. 88
      _sass/primer-base/lib/typography-base.scss
  17. 5
      _sass/primer-layout/index.scss
  18. 54
      _sass/primer-layout/lib/columns.scss
  19. 30
      _sass/primer-layout/lib/container.scss
  20. 19
      _sass/primer-layout/lib/grid-offset.scss
  21. 64
      _sass/primer-layout/lib/grid.scss
  22. 8
      _sass/primer-markdown/index.scss
  23. 27
      _sass/primer-markdown/lib/blob-csv.scss
  24. 63
      _sass/primer-markdown/lib/code.scss
  25. 65
      _sass/primer-markdown/lib/headings.scss
  26. 119
      _sass/primer-markdown/lib/images.scss
  27. 76
      _sass/primer-markdown/lib/lists.scss
  28. 106
      _sass/primer-markdown/lib/markdown-body.scss
  29. 33
      _sass/primer-markdown/lib/tables.scss
  30. 11
      _sass/primer-support/index.scss
  31. 160
      _sass/primer-support/lib/mixins/buttons.scss
  32. 58
      _sass/primer-support/lib/mixins/layout.scss
  33. 29
      _sass/primer-support/lib/mixins/misc.scss
  34. 84
      _sass/primer-support/lib/mixins/typography.scss
  35. 114
      _sass/primer-support/lib/variables/color-system.scss
  36. 67
      _sass/primer-support/lib/variables/colors.scss
  37. 72
      _sass/primer-support/lib/variables/layout.scss
  38. 40
      _sass/primer-support/lib/variables/misc.scss
  39. 43
      _sass/primer-support/lib/variables/typography.scss
  40. 14
      _sass/primer-utilities/index.scss
  41. 184
      _sass/primer-utilities/lib/animations.scss
  42. 100
      _sass/primer-utilities/lib/borders.scss
  43. 26
      _sass/primer-utilities/lib/box-shadow.scss
  44. 106
      _sass/primer-utilities/lib/colors.scss
  45. 18
      _sass/primer-utilities/lib/details.scss
  46. 52
      _sass/primer-utilities/lib/flexbox.scss
  47. 85
      _sass/primer-utilities/lib/layout.scss
  48. 53
      _sass/primer-utilities/lib/margin.scss
  49. 54
      _sass/primer-utilities/lib/padding.scss
  50. 215
      _sass/primer-utilities/lib/typography.scss
  51. 87
      _sass/primer-utilities/lib/visibility-display.scss
  52. 4
      _sass/primer.scss
  53. 209
      _sass/rouge.scss
  54. 254
      _sass/syntax.scss

35
README.md

@ -49,12 +49,11 @@
- [meta and other SEO tags](#meta-and-other-seo-tags)
- [Sitemap](#sitemap)
- [robots.txt](#robotstxt)
- [Mobile support](#mobile-support)
- [Compressed HTML output](#compressed-html-output)
- [HTML validation](#html-validation)
- [This version compared to the The Plain Libre](#this-version-compared-to-the-the-plain-libre)
- [Useful resources](#useful-resources)
- [Copyright and License](#copyright-and-license)
- [CSS](#css)
- [Changelog and trusted source](#changelog-and-trusted-source)
- [Crypto donations](#crypto-donations)
@ -62,7 +61,7 @@
## Blog content copyright and license
Copyright (C) Franco Masotti <franco.masotti@tutanota.com>
Copyright (C) Franco Masotti (franco \D\o\T masotti {-A-T-} tutanota \D\o\T com)
CC-BY-SA 4.0
@ -87,7 +86,7 @@ https://blog.franco.net.eu.org/
- No Javascript is used. See [The JavaScript Trap](https://www.gnu.org/philosophy/javascript-trap.html).
- No local fonts are served.
- No remote fonts are included (called).
- A very minimal CSS is served.
- [GitHub's primer theme](https://github.com/pages-themes/primer/) CSS is used.
<a href="https://www.buymeacoffee.com/frnmst" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" ></a>
@ -576,11 +575,6 @@ I guess that if you have multiple repository pages you can edit
the robots.txt file appropriately and set rules (and sitemap locations) for
each one of them.
### Mobile support
Mobile support is available for this theme through the CSS file through the
`@media` rules.
### Compressed HTML output
By default Jekyll leaves lots of whitespace in the html source. You can verify
@ -600,15 +594,6 @@ jekyll-compress-html is released under the MIT license.
This Jekyll theme has been checked with the [HTML5 W3C validator](https://validator.w3.org/nu/)
## This version compared to the The Plain Libre
There are too many things to compare, but in short terms:
- the CSS file was written from scratch.
- some Liquid templating language parts have been changed also because of the
new CSS.
- new tags score system for the index page.
## Useful resources
- https://www.w3.org/
@ -620,7 +605,7 @@ The MIT License (MIT)
Copyright (c) 2015 Heiswayi Nrird
Copyright (c) 2017-2021 Franco Masotti <franco.masotti@live.com>
Copyright (c) 2017-2021 Franco Masotti (franco \D\o\T masotti {-A-T-} tutanota \D\o\T com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -640,6 +625,18 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
### CSS
The MIT License (MIT)
Copyright (c) 2016-2017 GitHub, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
## Changelog and trusted source
You can check the authenticity of new releases using my public key.

1
_assets/badge-powered_by_jekyll.svg

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="116" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="116" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h75v20H0z"/><path fill="black" d="M75 0h41v20H75z"/><path fill="url(#b)" d="M0 0h116v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="385" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="650">powered by</text><text x="385" y="140" transform="scale(.1)" textLength="650">powered by</text><text x="945" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="310">Jekyll</text><text x="945" y="140" transform="scale(.1)" textLength="310">Jekyll</text></g> </svg>

Before

Width:  |  Height:  |  Size: 964 B

1
_assets/badge-uses_html5.svg

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="82" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="82" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h35v20H0z"/><path fill="black" d="M35 0h47v20H35z"/><path fill="url(#b)" d="M0 0h82v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="185" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">uses</text><text x="185" y="140" transform="scale(.1)" textLength="250">uses</text><text x="575" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="370">HTML5</text><text x="575" y="140" transform="scale(.1)" textLength="370">HTML5</text></g> </svg>

Before

Width:  |  Height:  |  Size: 947 B

1
_assets/badge-uses_minimal_css.svg

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="116" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="116" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h35v20H0z"/><path fill="black" d="M35 0h81v20H35z"/><path fill="url(#b)" d="M0 0h116v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="185" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">uses</text><text x="185" y="140" transform="scale(.1)" textLength="250">uses</text><text x="745" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="710">minimal CSS</text><text x="745" y="140" transform="scale(.1)" textLength="710">minimal CSS</text></g> </svg>

Before

Width:  |  Height:  |  Size: 962 B

3
_assets/core.scss

@ -10,5 +10,4 @@
#};
---
@import 'main';
@import 'syntax';
@import "jekyll-theme-primer";

7
_includes/footer.html

@ -16,11 +16,6 @@
{% endif %}
<hr>
<div>
<ul>
<li><a href="https://jekyllrb.com/"><img src="{{ site.baseurl }}/assets/badge-powered_by_jekyll.svg" alt="powered by Jekyll"></a></li>
<li><a href="https://www.gnu.org/philosophy/javascript-trap.en.html"><img src="{{ site.baseurl }}/assets/badge-no_javascript.svg" alt="no JavaScript"></a></li>
<li><a href="https://html.spec.whatwg.org/"><img src="{{ site.baseurl }}/assets/badge-uses_html5.svg" alt="uses HTML5"></a></li>
<li><a href="https://webdesign.tutsplus.com/articles/undress-to-impress-check-your-websites-without-css--cms-22489"><img src="{{ site.baseurl }}/assets/badge-uses_minimal_css.svg" alt="uses minimal CSS"></a></li>
</ul>
<a href="https://www.gnu.org/philosophy/javascript-trap.en.html"><img src="{{ site.baseurl }}/assets/badge-no_javascript.svg" alt="no JavaScript"></a>
</div>
</div>

2
_layouts/default.html

@ -9,6 +9,7 @@ layout: compress
{% include head.html %}
</head>
<body>
<div class="container-lg px-3 my-5 markdown-body">
{% include header.html %}
<hr>
@ -45,5 +46,6 @@ layout: compress
<hr>
{% include footer.html %}
</div>
</body>
</html>

1
_layouts/post.html

@ -29,6 +29,7 @@ layout: default
{% elsif page_date != page_updated %}
<div class="updated-on">Last updated on {{ page.updated | date: '%B %-d, %Y' }}</div>
{% endif %}
<hr>
</div>
<div class="post" id="main">

5
_posts/2020-02-06-what-happened-to-the-css.md

@ -1,7 +1,7 @@
---
title: What happened to the CSS?
tags: [css, website, blog]
updated: 2021-09-13 17:05:00
updated: 2022-07-21 17:49:00
description: Reasons for the removal of the CSS from this website
---
@ -17,6 +17,9 @@ This gives me some advantages:
If you have problems because of the absence of a dark theme, don't complain: install [Redshift](http://jonls.dk/redshift/).
Update 2022-07-21: now I'm using [GitHub's primer Jekyll theme](https://github.com/pages-themes/primer/) CSS because
it's more responsive and more elegant.
~
Cheers!

4
_posts/2021-02-21-an-alternative-to-github-pages.md

@ -1,7 +1,7 @@
---
title: An alternative to GitHub Pages
tags: [tutorial, hosting, gitlab, github, github-pages]
updated: 2021-09-13 14:07:00
updated: 2022-07-21 15:40:00
description: A DIY alternastive to GitHub and GitLab pages
---
@ -19,7 +19,7 @@ The first time you set up the pages do the following:
3. mkdir the destination directory
4. create a new executable file in `hooks/post-receive`, like this:
```
```shell
#!/usr/bin/bash -l
#
# The MIT License (MIT)

6
_sass/jekyll-theme-primer.scss

@ -0,0 +1,6 @@
@import "primer-support/index.scss";
@import "primer-base/index.scss";
@import "primer-utilities/index.scss";
@import "primer-layout/index.scss";
@import "primer-markdown/index.scss";
@import "rouge";

28
_sass/main.scss

@ -1,28 +0,0 @@
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
img {
max-width: 100%;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
padding: 1em;
}
/* Use "responsive" tables. See
https://www.w3schools.com/howto/howto_css_table_responsive.asp
https://stackoverflow.com/a/62451601
*/
table {
overflow-x:auto;
margin: 0;
border: none;
display: block;
}

5
_sass/primer-base/index.scss

@ -0,0 +1,5 @@
@import "primer-support/index.scss";
@import "./lib/normalize.scss";
@import "./lib/base.scss";
@import "./lib/typography-base.scss";

84
_sass/primer-base/lib/base.scss

@ -0,0 +1,84 @@
// stylelint-disable selector-max-type
* {
box-sizing: border-box;
}
input,
select,
textarea,
button {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
body {
font-family: $body-font;
font-size: $body-font-size;
line-height: $body-line-height;
color: $text-gray-dark;
background-color: $bg-white;
}
a {
color: $text-blue;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
b,
strong {
font-weight: $font-weight-bold;
}
// Horizontal lines
//
// TODO-MDO: Remove `.rule` from everywhere and replace with `<hr>`s
hr,
.rule {
height: 0;
margin: 15px 0;
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid lighten($gray-300, 5%);
@include clearfix();
}
//
// Remove most spacing between table cells.
//
table {
border-spacing: 0;
border-collapse: collapse;
}
td,
th {
padding: 0;
}
button {
cursor: pointer;
// Remove border radius added by Chroma macOS
border-radius: 0;
}
// increase the selector specificity for [hidden]
// so that it always overrides utility classes (.d-block, etc.)
[hidden][hidden] {
display: none !important;
}
details {
summary { cursor: pointer; }
&:not([open]) {
// Set details content hidden by default for browsers that don't do this
> *:not(summary) { display: none !important; }
}
}

423
_sass/primer-base/lib/normalize.scss vendored

@ -0,0 +1,423 @@
// stylelint-disable
/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */
/**
* 1. Change the default font family in all browsers (opinionated).
* 2. Prevent adjustments of font size after orientation changes in IE and iOS.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* Remove the margin in all browsers (opinionated).
*/
body {
margin: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Add the correct display in IE 9-.
* 1. Add the correct display in Edge, IE, and Firefox.
* 2. Add the correct display in IE.
*/
article,
aside,
details, /* 1 */
figcaption,
figure,
footer,
header,
main, /* 2 */
menu,
nav,
section { /* 1 */
display: block;
}
summary {
display: list-item;
}
/**
* Add the correct display in IE 9-.
*/
audio,
canvas,
progress,
video {
display: inline-block;
}
/**
* Add the correct display in iOS 4-7.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Add the correct display in IE 10-.
* 1. Add the correct display in IE.
*/
template, /* 1 */
[hidden] {
display: none !important;
}
/* Links
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent; /* 1 */
}
/**
* Remove the outline on focused links when they are also active or hovered
* in all browsers (opinionated).
*/
a:active,
a:hover {
outline-width: 0;
}
/* Text-level semantics
========================================================================== */
/**
* 1. Remove the bottom border in Firefox 39-.
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
*/
b,
strong {
font-weight: inherit;
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* Add the correct font style in Android 4.3-.
*/
dfn {
font-style: italic;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Add the correct background and color in IE 9-.
*/
mark {
background-color: #ff0;
color: #000;
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10-.
*/
img {
border-style: none;
}
/**
* Hide the overflow in IE.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct margin in IE 8.
*/
figure {
margin: 1em 40px;
}
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/* Forms
========================================================================== */
/**
* 1. Change font properties to `inherit` in all browsers (opinionated).
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
select,
textarea {
font: inherit; /* 1 */
margin: 0; /* 2 */
}
/**
* Restore the font weight unset by the previous rule.
*/
optgroup {
font-weight: bold;
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
* controls in Android 4.
* 2. Correct the inability to style clickable types in iOS and Safari.
*/
button,
html [type="button"], /* 1 */
[type="reset"],
[type="submit"] {
-webkit-appearance: button; /* 2 */
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Change the border, margin, and padding in all browsers (opinionated).
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* Remove the default vertical scrollbar in IE.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10-.
* 2. Remove the padding in IE 10-.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding and cancel buttons in Chrome and Safari on OS X.
*/
[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Correct the text style of placeholders in Chrome, Edge, and Safari.
*/
::-webkit-input-placeholder {
color: inherit;
opacity: 0.54;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}

88
_sass/primer-base/lib/typography-base.scss

@ -0,0 +1,88 @@
// Headings
// --------------------------------------------------
// stylelint-disable selector-max-type
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: 0;
margin-bottom: 0;
}
h1 { @include h1; }
h2 { @include h2; }
h3 { @include h3; }
h4 { @include h4; }
h5 { @include h5; }
h6 { @include h6; }
// Body text
// --------------------------------------------------
p {
margin-top: 0;
margin-bottom: 10px;
}
small {
font-size: 90%;
}
blockquote {
margin: 0;
}
// Lists
// --------------------------------------------------
/*
ul,
ol {
padding-left: 0;
margin-top: 0;
margin-bottom: 0;
}
*/
ol ol,
ul ol {
list-style-type: lower-roman;
}
ul ul ol,
ul ol ol,
ol ul ol,
ol ol ol {
list-style-type: lower-alpha;
}
dd {
margin-left: 0;
}
// Code
// --------------------------------------------------
tt,
code {
font-family: $mono-font;
font-size: $font-size-small;
}
pre {
margin-top: 0;
margin-bottom: 0;
font-family: $mono-font;
font-size: $font-size-small;
}
// Octicons
// --------------------------------------------------
// Move this over here as a temporary override to the octicons source repo
// instead of updating that upstream.
.octicon {
vertical-align: text-bottom;
}

5
_sass/primer-layout/index.scss

@ -0,0 +1,5 @@
@import "primer-support/index.scss";
@import "./lib/container.scss";
@import "./lib/columns.scss";
@import "./lib/grid.scss";
@import "./lib/grid-offset.scss";

54
_sass/primer-layout/lib/columns.scss

@ -0,0 +1,54 @@
// Grid system
//
// Create rows with `.columns` to clear the floated columns and outdent the
// padding on `.column`s with negative margin for alignment.
.columns {
margin-right: -$grid-gutter;
margin-left: -$grid-gutter;
@include clearfix;
}
// Base class for every column (requires a column width from below)
.column {
float: left;
padding-right: $grid-gutter;
padding-left: $grid-gutter;
}
// Column widths
.one-third {
width: 33.333333%;
}
.two-thirds {
width: 66.666667%;
}
.one-fourth {
width: 25%;
}
.one-half {
width: 50%;
}
.three-fourths {
width: 75%;
}
.one-fifth {
width: 20%;
}
.four-fifths {
width: 80%;
}
// Centers content horizontally. Can be used inside or outside the grid.
.centered {
display: block;
float: none;
margin-right: auto;
margin-left: auto;
}

30
_sass/primer-layout/lib/container.scss

@ -0,0 +1,30 @@
// Fixed-width, centered column for site content.
// This will be deprecated and replaced with container-lg in future
.container {
width: $container-width;
margin-right: auto;
margin-left: auto;
@include clearfix;
}
// Handy container styles that match our breakpoints
// 768px
.container-md {
max-width: $container-md;
margin-right: auto;
margin-left: auto;
}
// 1004px - this matches the current fixed width: 980px + padding: px-3
.container-lg {
max-width: $container-lg;
margin-right: auto;
margin-left: auto;
}
// 1280px
.container-xl {
max-width: $container-xl;
margin-right: auto;
margin-left: auto;
}

19
_sass/primer-layout/lib/grid-offset.scss

@ -0,0 +1,19 @@
// Optional offset options to work with grid.scss
// Offset Columns
@each $breakpoint, $variant in $responsive-variants {
@include breakpoint($breakpoint) {
.offset#{$variant}-1 { margin-left: (1 / 12 * 100%) !important; }
.offset#{$variant}-2 { margin-left: (2 / 12 * 100%) !important; }
.offset#{$variant}-3 { margin-left: (3 / 12 * 100%) !important; }
.offset#{$variant}-4 { margin-left: (4 / 12 * 100%) !important; }
.offset#{$variant}-5 { margin-left: (5 / 12 * 100%) !important; }
.offset#{$variant}-6 { margin-left: (6 / 12 * 100%) !important; }
.offset#{$variant}-7 { margin-left: (7 / 12 * 100%) !important; }
.offset#{$variant}-8 { margin-left: (8 / 12 * 100%) !important; }
.offset#{$variant}-9 { margin-left: (9 / 12 * 100%) !important; }
.offset#{$variant}-10 { margin-left: (10 / 12 * 100%) !important; }
.offset#{$variant}-11 { margin-left: (11 / 12 * 100%) !important; }
}
}

64
_sass/primer-layout/lib/grid.scss

@ -0,0 +1,64 @@
// GRID
// Columns
.col-1 { width: (1 / 12 * 100%); }
.col-2 { width: (2 / 12 * 100%); }
.col-3 { width: (3 / 12 * 100%); }
.col-4 { width: (4 / 12 * 100%); }
.col-5 { width: (5 / 12 * 100%); }
.col-6 { width: (6 / 12 * 100%); }
.col-7 { width: (7 / 12 * 100%); }
.col-8 { width: (8 / 12 * 100%); }
.col-9 { width: (9 / 12 * 100%); }
.col-10 { width: (10 / 12 * 100%); }
.col-11 { width: (11 / 12 * 100%); }
.col-12 { width: 100%; }
@each $breakpoint in map-keys($breakpoints) {
@include breakpoint($breakpoint) {
.col-#{$breakpoint}-1 { width: ( 1 / 12 * 100%); }
.col-#{$breakpoint}-2 { width: ( 2 / 12 * 100%); }
.col-#{$breakpoint}-3 { width: ( 3 / 12 * 100%); }
.col-#{$breakpoint}-4 { width: ( 4 / 12 * 100%); }
.col-#{$breakpoint}-5 { width: ( 5 / 12 * 100%); }
.col-#{$breakpoint}-6 { width: ( 6 / 12 * 100%); }
.col-#{$breakpoint}-7 { width: ( 7 / 12 * 100%); }
.col-#{$breakpoint}-8 { width: ( 8 / 12 * 100%); }
.col-#{$breakpoint}-9 { width: ( 9 / 12 * 100%); }
.col-#{$breakpoint}-10 { width: ( 10 / 12 * 100%); }
.col-#{$breakpoint}-11 { width: ( 11 / 12 * 100%); }
.col-#{$breakpoint}-12 { width: 100%; }
}
}
// Gutters
// Apply padding and a negative margin to the outside of the container
@mixin gutters ($gutter-width: $spacer-3) {
margin-right: -$gutter-width;
margin-left: -$gutter-width;
> [class*="col-"] {
padding-right: $gutter-width !important;
padding-left: $gutter-width !important;
}
}
.gutter {
@include gutters($spacer-3);
}
.gutter-condensed {
@include gutters($spacer-2);
}
.gutter-spacious {
@include gutters($spacer-4);
}
@each $breakpoint in map-keys($breakpoints) {
@include breakpoint($breakpoint) {
.gutter-#{$breakpoint} { @include gutters($spacer-3); }
.gutter-#{$breakpoint}-condensed { @include gutters($spacer-2); }
.gutter-#{$breakpoint}-spacious { @include gutters($spacer-4); }
}
}

8
_sass/primer-markdown/index.scss

@ -0,0 +1,8 @@
@import "primer-support/index.scss";
@import "./lib/markdown-body.scss";
@import "./lib/headings.scss";
@import "./lib/lists.scss";
@import "./lib/tables.scss";
@import "./lib/images.scss";
@import "./lib/code.scss";
@import "./lib/blob-csv.scss";

27
_sass/primer-markdown/lib/blob-csv.scss

@ -0,0 +1,27 @@
// stylelint-disable selector-max-type
.markdown-body .csv-data {
td,
th {
padding: 5px;
overflow: hidden;
font-size: $font-size-small;
line-height: $lh-condensed-ultra;
text-align: left;
white-space: nowrap;
}
.blob-num {
padding: 10px $spacer-2 9px;
text-align: right;
background: $bg-white;
border: 0;
}
tr { border-top: 0; }
th {
font-weight: $font-weight-bold;
background: $gray-100;
border-top: 0;
}
}

63
_sass/primer-markdown/lib/code.scss

@ -0,0 +1,63 @@
// stylelint-disable selector-max-type
.markdown-body {
// Inline code snippets
code,
tt {
padding: 0.2em 0.4em;
margin: 0;
font-size: 85%;
background-color: rgba($black, 0.05);
border-radius: $border-radius;
br { display: none; }
}
del code { text-decoration: inherit; }
pre {
word-wrap: normal;
// Code tags within code blocks (<pre>s)
> code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
}
.highlight {
margin-bottom: $spacer-3;
pre {
margin-bottom: 0;
word-break: normal;
}
}
.highlight pre,
pre {
padding: $spacer-3;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: $gray-100;
border-radius: $border-radius;
}
pre code,
pre tt {
display: inline;
max-width: auto;
padding: 0;
margin: 0;
overflow: visible;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
}

65
_sass/primer-markdown/lib/headings.scss

@ -0,0 +1,65 @@
// Needs refactoring
// stylelint-disable selector-max-compound-selectors, selector-max-specificity
// stylelint-disable selector-max-type
.markdown-body {
// Headings
h1,
h2,
h3,
h4,
h5,
h6 {
margin-top: $spacer-4;
margin-bottom: $spacer-3;
font-weight: $font-weight-bold;
line-height: $lh-condensed;
.octicon-link {
color: $black;
vertical-align: middle;
visibility: hidden;
}
&:hover .anchor {
text-decoration: none;
.octicon-link {
visibility: visible;
}
}
tt,
code {
font-size: inherit;
}
}
h1 {
padding-bottom: 0.3em;
font-size: 2em;
border-bottom: 1px solid lighten($gray-200, 3%);
}
h2 {
padding-bottom: 0.3em;
font-size: 1.5em;
border-bottom: 1px solid lighten($gray-200, 3%);
}
h3 {
font-size: 1.25em;
}
h4 {
font-size: 1em;
}
h5 {
font-size: 0.875em;
}
h6 {
font-size: 0.85em;
color: $gray-500;
}
}

119
_sass/primer-markdown/lib/images.scss

@ -0,0 +1,119 @@
// Need to target base styles
// stylelint-disable selector-max-compound-selectors, selector-no-qualifying-type, primer/selector-no-utility
// stylelint-disable selector-max-type
.markdown-body {
// Images & Stuff
img {
max-width: 100%;
// because we put padding on the images to hide header lines, and some people
// specify the width of their images in their markdown.
box-sizing: content-box;
background-color: $bg-white;
&[align=right] {
padding-left: 20px;
}
&[align=left] {
padding-right: 20px;
}
}
.emoji {
max-width: none;
vertical-align: text-top;
// Override `<img>` styles so Emjois don't clash with zebra striping in our tables
background-color: transparent;
}
// Gollum Image Tags
// Framed
span.frame {
display: block;
overflow: hidden;
> span {
display: block;
float: left;
width: auto;
padding: 7px;
margin: 13px 0 0;
overflow: hidden;
border: 1px solid lighten($gray-300, 5%);
}
span img {
display: block;
float: left;
}
span span {
display: block;
padding: 5px 0 0;
clear: both;
color: $text-gray-dark;
}
}
span.align-center {
display: block;
overflow: hidden;
clear: both;
> span {
display: block;
margin: 13px auto 0;
overflow: hidden;
text-align: center;
}
span img {
margin: 0 auto;
text-align: center;
}
}
span.align-right {
display: block;
overflow: hidden;
clear: both;
> span {
display: block;
margin: 13px 0 0;
overflow: hidden;
text-align: right;
}
span img {
margin: 0;
text-align: right;
}
}
span.float-left {
display: block;
float: left;
margin-right: 13px;
overflow: hidden;
span {
margin: 13px 0 0;
}
}
span.float-right {
display: block;
float: right;
margin-left: 13px;
overflow: hidden;
> span {
display: block;
margin: 13px auto 0;
overflow: hidden;
text-align: right;
}
}
}

76
_sass/primer-markdown/lib/lists.scss

@ -0,0 +1,76 @@
// Base styles
// stylelint-disable selector-no-qualifying-type
// stylelint-disable selector-max-type
.markdown-body {
// Lists, Blockquotes & Such
ul,
ol {
padding-left: 2em;
&.no-list {
padding: 0;
list-style-type: none;
}
}
// Did someone complain about list spacing? Encourage them
// to create the spacing with their markdown formatting.
// List behavior should be controled by the markup, not the css.
//
// For lists with padding between items, use blank
// lines between items. This will generate paragraphs with
// padding to space things out.
//
// - item
//
// - item
//
// - item
//
// For list without padding, don't use blank lines.
//
// - item
// - item
// - item
//
// Modifying the css to emulate these behaviors merely brakes
// one case in the process of solving another. Don't change
// this unless it's really really a bug.
ul ul,
ul ol,
ol ol,
<