debian-mirror-gitlab/app/assets/stylesheets/framework/typography.scss

760 lines
13 KiB
SCSS
Raw Normal View History

2019-07-07 11:18:12 +05:30
/**
2019-09-30 21:07:59 +05:30
* Apply Markup (Markdown/AsciiDoc) typography
2019-07-07 11:18:12 +05:30
*
*/
2019-12-04 20:38:33 +05:30
.md {
2017-08-17 22:00:37 +05:30
color: $gl-text-color;
2015-10-24 18:46:33 +05:30
word-wrap: break-word;
2019-07-07 11:18:12 +05:30
[dir='auto'] {
2017-09-10 17:25:29 +05:30
text-align: initial;
}
2019-07-07 11:18:12 +05:30
*:first-child {
margin-top: 0;
}
> :last-child {
margin-bottom: 0;
}
p {
color: $gl-text-color;
margin: 0 0 16px;
> code {
font-weight: inherit;
}
a:not(.no-attachment-icon) img {
// Remove bottom padding because
// <p> already has $gl-padding bottom
margin-bottom: 0;
}
}
2015-10-24 18:46:33 +05:30
a {
2018-11-20 20:47:30 +05:30
color: $blue-600;
2019-07-07 11:18:12 +05:30
> code {
color: $blue-600;
}
2015-10-24 18:46:33 +05:30
}
2021-11-11 11:23:49 +05:30
.media-container {
display: inline-flex;
flex-direction: column;
margin-bottom: $gl-spacing-scale-2;
}
2018-03-17 18:26:18 +05:30
img:not(.emoji) {
2017-08-17 22:00:37 +05:30
margin: 0 0 8px;
2015-10-24 18:46:33 +05:30
}
2017-09-10 17:25:29 +05:30
img.lazy {
min-width: 200px;
min-height: 100px;
background-color: $gray-lightest;
}
img.js-lazy-loaded,
img.emoji {
min-width: inherit;
min-height: inherit;
background-color: inherit;
max-width: 100%;
}
2020-04-08 14:13:33 +05:30
&:not(.md) img:not(.emoji) {
2019-07-07 11:18:12 +05:30
border: 1px solid $white-normal;
padding: 5px;
margin: 5px 0;
// Ensure that image does not exceed viewport
max-height: calc(100vh - 100px);
2017-09-10 17:25:29 +05:30
}
2019-12-04 20:38:33 +05:30
details {
margin-bottom: $gl-padding;
2021-11-18 22:05:49 +05:30
> *:not(summary) {
margin-left: $gl-spacing-scale-5;
}
}
summary > * {
display: inline-block;
margin-bottom: 0;
2019-12-04 20:38:33 +05:30
}
2016-09-13 17:45:13 +05:30
// Single code lines should wrap
2015-10-24 18:46:33 +05:30
code {
2018-11-18 11:00:15 +05:30
font-family: $monospace-font;
2016-09-13 17:45:13 +05:30
white-space: pre-wrap;
2021-04-17 20:07:23 +05:30
// Safari
word-wrap: break-word;
overflow-wrap: break-word;
2019-07-07 11:18:12 +05:30
word-break: keep-all;
2016-09-13 17:45:13 +05:30
}
2015-10-24 18:46:33 +05:30
h1 {
2016-11-03 12:29:30 +05:30
font-size: 1.75em;
2018-03-17 18:26:18 +05:30
font-weight: $gl-font-weight-bold;
2017-08-17 22:00:37 +05:30
margin: 24px 0 16px;
padding-bottom: 0.3em;
2016-11-03 12:29:30 +05:30
border-bottom: 1px solid $white-dark;
2017-08-17 22:00:37 +05:30
color: $gl-text-color;
&:first-child {
margin-top: 0;
}
2015-10-24 18:46:33 +05:30
}
h2 {
2016-11-03 12:29:30 +05:30
font-size: 1.5em;
2018-03-17 18:26:18 +05:30
font-weight: $gl-font-weight-bold;
2017-08-17 22:00:37 +05:30
margin: 24px 0 16px;
padding-bottom: 0.3em;
border-bottom: 1px solid $white-dark;
color: $gl-text-color;
2015-10-24 18:46:33 +05:30
}
h3 {
2017-08-17 22:00:37 +05:30
margin: 24px 0 16px;
2016-11-03 12:29:30 +05:30
font-size: 1.3em;
2015-10-24 18:46:33 +05:30
}
h4 {
2017-08-17 22:00:37 +05:30
margin: 24px 0 16px;
2016-11-03 12:29:30 +05:30
font-size: 1.2em;
2015-10-24 18:46:33 +05:30
}
h5 {
2017-08-17 22:00:37 +05:30
margin: 24px 0 16px;
2016-09-13 17:45:13 +05:30
font-size: 1em;
2015-10-24 18:46:33 +05:30
}
h6 {
2017-08-17 22:00:37 +05:30
margin: 24px 0 16px;
2016-09-13 17:45:13 +05:30
font-size: 0.95em;
2015-10-24 18:46:33 +05:30
}
2018-11-08 19:23:39 +05:30
blockquote,
.blockquote {
2017-08-17 22:00:37 +05:30
color: $gl-grayish-blue;
2015-10-24 18:46:33 +05:30
font-size: inherit;
2017-08-17 22:00:37 +05:30
padding: 8px 24px;
margin: 16px 0;
2016-11-03 12:29:30 +05:30
border-left: 3px solid $white-dark;
2018-11-08 19:23:39 +05:30
&:dir(rtl) {
border-left: 0;
border-right: 3px solid $white-dark;
}
2015-10-24 18:46:33 +05:30
2018-11-08 19:23:39 +05:30
p {
color: $gl-grayish-blue !important;
font-size: inherit;
line-height: 1.5;
2017-09-10 17:25:29 +05:30
2018-11-08 19:23:39 +05:30
&:last-child {
margin: 0;
}
2017-09-10 17:25:29 +05:30
}
2015-10-24 18:46:33 +05:30
}
2019-07-07 11:18:12 +05:30
hr {
// Darken 'whitesmoke' a bit to make it more visible in note bodies
border-color: darken($gray-normal, 8%);
margin: 10px 0;
2015-10-24 18:46:33 +05:30
}
2019-07-07 11:18:12 +05:30
table:not(.code) {
2017-08-17 22:00:37 +05:30
margin: 16px 0;
color: $gl-text-color;
2019-03-02 22:35:43 +05:30
border: 0;
2019-07-07 11:18:12 +05:30
width: auto;
display: block;
overflow-x: auto;
2016-11-03 12:29:30 +05:30
2019-07-07 11:18:12 +05:30
tbody {
2020-04-22 19:07:51 +05:30
background-color: $white;
2020-03-13 15:44:24 +05:30
2021-11-18 22:05:49 +05:30
}
td,
th {
border: 1px solid $border-color;
2019-07-07 11:18:12 +05:30
}
tr {
th {
2020-10-24 23:57:45 +05:30
border-bottom: solid 2px $gray-200;
2019-07-07 11:18:12 +05:30
}
2015-10-24 18:46:33 +05:30
}
2019-12-21 20:55:43 +05:30
&.grid-none {
> thead > tr {
> th {
border-bottom-width: 0;
border-right-width: 0;
border-left-width: 0;
&:first-child {
border-left-width: 1px;
}
&:last-child {
border-right-width: 1px;
}
}
}
> tbody {
> tr > td {
border-width: 0;
&:first-child {
border-left-width: 1px;
}
&:last-child {
border-right-width: 1px;
}
}
> tr:last-child > td {
border-bottom-width: 1px;
}
}
}
&.grid-rows {
> thead > tr > th,
> tbody > tr > td {
border-right-width: 0;
border-left-width: 0;
}
> thead > tr {
> th:first-child {
border-left-width: 1px;
}
> th:last-child {
border-right-width: 1px;
}
}
> tbody > tr {
> td {
border-left-width: 0;
border-right-width: 0;
}
> td:first-child {
border-left-width: 1px;
}
> td:last-child {
border-right-width: 1px;
}
}
}
&.grid-cols {
> thead > tr > th {
border-bottom-width: 0;
}
> tbody > tr > td {
border-top-width: 0;
border-bottom-width: 0;
}
> tbody > tr:last-child > td {
border-bottom-width: 1px;
}
}
&.frame-sides {
> thead > tr > th {
border-top-width: 0;
}
> tbody > tr:last-child > td {
border-bottom-width: 0;
}
}
&.frame-topbot,
&.frame-ends {
> thead > tr > th:first-child,
> tbody > tr > td:first-child {
border-left-width: 0;
}
> thead > tr > th:last-child,
> tbody > tr > td:last-child {
border-right-width: 0;
}
}
&.frame-none {
> thead > tr > th {
border-top-width: 0;
}
> tbody > tr:last-child > td {
border-bottom-width: 0;
}
> thead > tr > th:first-child,
> tbody > tr > td:first-child {
border-left-width: 0;
}
> thead > tr > th:last-child,
> tbody > tr > td:last-child {
border-right-width: 0;
}
}
&.stripes-all tr,
&.stripes-odd tr:nth-of-type(odd),
&.stripes-even tr:nth-of-type(even),
&.stripes-hover tr:hover {
background: $gray-light;
}
2015-10-24 18:46:33 +05:30
}
2016-11-03 12:29:30 +05:30
table:dir(rtl) th {
text-align: right;
}
2015-10-24 18:46:33 +05:30
pre {
2017-08-17 22:00:37 +05:30
margin-bottom: 16px;
2016-02-05 20:25:01 +05:30
font-size: 13px;
line-height: 1.6em;
overflow-x: auto;
2016-11-03 12:29:30 +05:30
border-radius: 2px;
2017-09-10 17:25:29 +05:30
2019-07-07 11:18:12 +05:30
// Multi-line code blocks should scroll horizontally
code {
white-space: pre;
2021-04-17 20:07:23 +05:30
// Safari
word-wrap: normal;
overflow-wrap: normal;
2019-07-07 11:18:12 +05:30
}
2017-09-10 17:25:29 +05:30
&.plain-readme {
background: none;
2018-03-17 18:26:18 +05:30
border: 0;
2017-09-10 17:25:29 +05:30
padding: 0;
margin: 0;
font-size: 14px;
}
2015-10-24 18:46:33 +05:30
}
2018-03-17 18:26:18 +05:30
dd {
margin-left: $gl-padding;
}
2017-08-17 22:00:37 +05:30
ul,
ol {
2015-10-24 18:46:33 +05:30
padding: 0;
2017-09-10 17:25:29 +05:30
margin: 0 0 16px;
2019-09-30 21:07:59 +05:30
2022-03-02 08:16:31 +05:30
// Lists embedded in other lists can be "loose" or "tight"
// Remove bottom margin for all lists (default for tight lists)
2019-09-30 21:07:59 +05:30
ul,
ol {
margin-bottom: 0;
}
2022-03-02 08:16:31 +05:30
// Loose lists need bottom margin added back
p ~ ol,
p ~ ul {
margin-bottom: 16px; }
2015-10-24 18:46:33 +05:30
}
2017-08-17 22:00:37 +05:30
ul:dir(rtl),
ol:dir(rtl) {
2016-11-03 12:29:30 +05:30
margin: 3px 28px 3px 0 !important;
}
2019-07-07 11:18:12 +05:30
> ul {
list-style-type: disc;
ul {
list-style-type: circle;
ul {
list-style-type: square;
}
}
}
2019-09-30 21:07:59 +05:30
ul.checklist,
ul.none,
ol.none,
ul.no-bullet,
ol.no-bullet,
ol.unnumbered,
ul.unstyled,
ol.unstyled {
list-style-type: none;
li {
margin-left: 0;
}
}
2015-10-24 18:46:33 +05:30
li {
line-height: 1.6em;
2017-08-17 22:00:37 +05:30
margin-left: 25px;
padding-left: 3px;
/* Normalize the bullet position on webkit. */
@include on-webkit-only {
margin-left: 28px;
padding-left: 0;
}
2015-10-24 18:46:33 +05:30
}
2017-08-17 22:00:37 +05:30
ul.task-list {
2017-09-10 17:25:29 +05:30
> li.task-list-item {
2017-08-17 22:00:37 +05:30
list-style-type: none;
position: relative;
min-height: 22px;
2022-03-02 08:16:31 +05:30
padding-inline-start: 28px;
margin-inline-start: 0 !important;
2017-08-17 22:00:37 +05:30
2017-09-10 17:25:29 +05:30
> input.task-list-item-checkbox {
2017-08-17 22:00:37 +05:30
position: absolute;
2022-03-02 08:16:31 +05:30
inset-inline-start: 8px;
2017-08-17 22:00:37 +05:30
top: 5px;
}
}
}
2021-04-29 21:17:54 +05:30
a.with-attachment-icon,
a[href*='/uploads/'],
a[href*='storage.googleapis.com/google-code-attachments/'] {
2017-08-17 22:00:37 +05:30
&::before {
2015-10-24 18:46:33 +05:30
margin-right: 4px;
2021-02-22 17:27:13 +05:30
font-style: normal;
2015-10-24 18:46:33 +05:30
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
2021-02-22 17:27:13 +05:30
content: '📎';
2015-10-24 18:46:33 +05:30
}
2021-04-17 20:07:23 +05:30
}
a[href*='/uploads/'],
a[href*='storage.googleapis.com/google-code-attachments/'] {
2019-07-07 11:18:12 +05:30
&.no-attachment-icon {
&::before {
display: none;
}
2016-06-02 11:05:42 +05:30
}
}
2015-10-24 18:46:33 +05:30
/* Link to current header. */
2017-08-17 22:00:37 +05:30
h1,
h2,
h3,
h4,
h5,
h6 {
2015-10-24 18:46:33 +05:30
a.anchor {
2021-01-29 00:20:46 +05:30
float: left;
2021-03-11 19:13:27 +05:30
margin-left: -20px;
2016-09-29 09:46:39 +05:30
text-decoration: none;
2017-08-17 22:00:37 +05:30
outline: none;
2016-09-29 09:46:39 +05:30
2017-08-17 22:00:37 +05:30
&::after {
2016-09-29 09:46:39 +05:30
content: image-url('icon_anchor.svg');
visibility: hidden;
}
2015-10-24 18:46:33 +05:30
}
2017-08-17 22:00:37 +05:30
&:hover > a.anchor::after {
2016-09-29 09:46:39 +05:30
visibility: visible;
2015-10-24 18:46:33 +05:30
}
2021-03-11 19:13:27 +05:30
> a.anchor:focus::after {
visibility: visible;
outline: auto;
}
2015-10-24 18:46:33 +05:30
}
2019-09-30 21:07:59 +05:30
.big {
font-size: larger;
}
2021-11-18 22:05:49 +05:30
figcaption,
2019-09-30 21:07:59 +05:30
.small {
font-size: smaller;
}
.underline {
text-decoration: underline;
}
.overline {
text-decoration: overline;
}
.line-through {
text-decoration: line-through;
}
2021-04-29 21:17:54 +05:30
// Custom Font Awesome styles that render emojis in asciidoc
.fa {
display: inline-block;
font-style: normal;
font-size: 14px;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
2019-09-30 21:07:59 +05:30
2021-04-29 21:17:54 +05:30
.fa-2x,
.admonitionblock td.icon [class^='fa icon-'] {
font-size: 2em;
}
2019-09-30 21:07:59 +05:30
2021-04-29 21:17:54 +05:30
.fa-exclamation-triangle::before,
.admonitionblock td.icon .icon-warning::before {
content: '';
}
2019-09-30 21:07:59 +05:30
2021-04-29 21:17:54 +05:30
.fa-exclamation-circle::before,
.admonitionblock td.icon .icon-important::before {
content: '';
}
2019-09-30 21:07:59 +05:30
2021-04-29 21:17:54 +05:30
.fa-lightbulb-o::before,
.admonitionblock td.icon .icon-tip::before {
content: '💡';
}
2019-09-30 21:07:59 +05:30
2021-04-29 21:17:54 +05:30
.fa-thumb-tack::before,
.admonitionblock td.icon .icon-note::before {
content: '📌';
}
2019-09-30 21:07:59 +05:30
2021-04-29 21:17:54 +05:30
.fa-fire::before,
.admonitionblock td.icon .icon-caution::before {
content: '🔥';
}
.fa-square-o::before {
content: '\2610';
}
.fa-check-square-o::before {
content: '\2611';
}
.admonitionblock td.icon {
width: 1%;
2019-09-30 21:07:59 +05:30
}
2015-10-24 18:46:33 +05:30
2019-12-21 20:55:43 +05:30
.metrics-embed {
2019-12-04 20:38:33 +05:30
h3.popover-header {
/** Override <h3> .popover-header
* as embed metrics do not follow the same
* style as default md <h3> (which are deeply nested)
*/
margin: 0;
font-size: $gl-font-size-small;
}
2021-11-11 11:23:49 +05:30
}
2020-05-24 23:13:21 +05:30
2021-11-11 11:23:49 +05:30
.gl-new-dropdown-item {
margin: 0;
padding: 0;
line-height: 1rem;
2019-12-04 20:38:33 +05:30
}
2020-06-23 00:09:42 +05:30
/* AsciiDoc(tor) built-in alignment roles */
.text-left {
text-align: left !important;
}
.text-right {
text-align: right !important;
}
.text-center {
text-align: center !important;
}
.text-justify {
text-align: justify !important;
}
2022-03-02 08:16:31 +05:30
@include email-code-block;
2019-12-04 20:38:33 +05:30
}
2015-10-24 18:46:33 +05:30
/**
* Headers
*
*/
body {
2017-08-17 22:00:37 +05:30
-webkit-text-shadow: $body-text-shadow 0 0 1px;
2015-10-24 18:46:33 +05:30
}
.page-title {
2018-12-05 23:21:45 +05:30
margin: #{2 * $grid-size} 0;
2015-10-24 18:46:33 +05:30
line-height: 1.3;
font-size: 1.25em;
2018-03-17 18:26:18 +05:30
font-weight: $gl-font-weight-bold;
2015-12-23 02:04:40 +05:30
2018-05-09 12:01:36 +05:30
&.with-button {
line-height: 34px;
}
2015-10-24 18:46:33 +05:30
}
.page-title-empty {
2019-07-07 11:18:12 +05:30
margin: 12px 0;
2015-10-24 18:46:33 +05:30
line-height: 1.3;
font-size: 1.25em;
2018-03-17 18:26:18 +05:30
font-weight: $gl-font-weight-bold;
2016-06-02 11:05:42 +05:30
}
.light-header {
2018-03-17 18:26:18 +05:30
font-weight: $gl-font-weight-bold;
2015-10-24 18:46:33 +05:30
}
/** CODE **/
pre {
2022-01-26 12:08:38 +05:30
@include gl-relative;
2018-11-18 11:00:15 +05:30
font-family: $monospace-font;
2018-11-08 19:23:39 +05:30
display: block;
2018-11-20 20:47:30 +05:30
padding: $gl-padding-8 $input-horizontal-padding;
2018-11-08 19:23:39 +05:30
margin: 0 0 $gl-padding-8;
2021-04-17 20:07:23 +05:30
font-size: $gl-font-size-monospace;
2018-11-08 19:23:39 +05:30
word-break: break-all;
word-wrap: break-word;
color: $gl-text-color;
background-color: $gray-light;
2020-07-28 23:09:34 +05:30
border: 1px solid $gray-100;
2018-11-08 19:23:39 +05:30
border-radius: $border-radius-small;
2022-01-26 12:08:38 +05:30
// Select only code elements that will have the copy code button
.markdown-code-block & {
padding: $input-horizontal-padding;
}
2015-10-24 18:46:33 +05:30
}
code {
&.key-fingerprint {
background: $body-bg;
color: $text-color;
}
}
2017-09-10 17:25:29 +05:30
.monospace {
2018-11-18 11:00:15 +05:30
font-family: $monospace-font;
2017-09-10 17:25:29 +05:30
}
2018-03-27 19:54:05 +05:30
.weight-normal {
font-weight: $gl-font-weight-normal;
}
2017-09-10 17:25:29 +05:30
.commit-sha,
2018-11-08 19:23:39 +05:30
.ref-name,
.pipeline-number {
2021-04-29 21:17:54 +05:30
font-family: $monospace-font;
2017-09-10 17:25:29 +05:30
font-size: 95%;
}
2021-04-29 21:17:54 +05:30
.git-revision-dropdown .dropdown-content li:not(.dropdown-menu-empty-item) a {
font-family: $monospace-font;
font-size: 95%;
2019-09-04 21:01:54 +05:30
word-break: break-all;
2017-09-10 17:25:29 +05:30
}
2015-10-24 18:46:33 +05:30
/**
* Textareas intended for GFM
*
*/
2017-08-17 22:00:37 +05:30
textarea.js-gfm-input {
2018-11-18 11:00:15 +05:30
font-family: $monospace-font;
2021-04-17 20:07:23 +05:30
font-size: $gl-font-size-monospace;
2017-08-17 22:00:37 +05:30
}
2015-10-24 18:46:33 +05:30
.strikethrough {
text-decoration: line-through;
}
2015-12-23 02:04:40 +05:30
2017-08-17 22:00:37 +05:30
h1,
h2,
h3,
h4 {
2015-12-23 02:04:40 +05:30
small {
2017-08-17 22:00:37 +05:30
color: $gl-text-color;
2015-12-23 02:04:40 +05:30
}
}
2016-06-02 11:05:42 +05:30
2020-01-01 13:55:28 +05:30
.text-right-md {
@include media-breakpoint-up(md) {
text-align: right;
}
}
2016-06-02 11:05:42 +05:30
.text-right-lg {
2018-11-08 19:23:39 +05:30
@include media-breakpoint-up(lg) {
2016-06-02 11:05:42 +05:30
text-align: right;
}
}
.idiff.deletion {
background: $line-removed-dark;
}
.idiff.addition {
background: $line-added-dark;
}
2017-08-17 22:00:37 +05:30
/**
* form text input i.e. search bar, comments, forms, etc.
*/
2019-07-07 11:18:12 +05:30
/* stylelint-disable selector-no-vendor-prefix */
2017-08-17 22:00:37 +05:30
input,
textarea {
&::-webkit-input-placeholder {
2018-11-20 20:47:30 +05:30
color: $gl-text-color-tertiary;
2017-08-17 22:00:37 +05:30
}
// support firefox 19+ vendor prefix
&::-moz-placeholder {
2018-11-20 20:47:30 +05:30
color: $gl-text-color-tertiary;
2017-08-17 22:00:37 +05:30
opacity: 1; // FF defaults to 0.54
}
// support Edge vendor prefix
&::-ms-input-placeholder {
2018-11-20 20:47:30 +05:30
color: $gl-text-color-tertiary;
2017-08-17 22:00:37 +05:30
}
// support IE vendor prefix
&:-ms-input-placeholder {
2018-11-20 20:47:30 +05:30
color: $gl-text-color-tertiary;
2017-08-17 22:00:37 +05:30
}
}
2019-07-07 11:18:12 +05:30
/* stylelint-enable */
2018-11-18 11:00:15 +05:30
.lh-100 { line-height: 1; }
2019-07-31 22:56:46 +05:30
wbr {
display: inline-block;
}