这段CSS代码定义了一个名为"Guardian Headline Full"的自定义字体族,包含多种字重和样式。它涵盖了细体、常规体、中等体和半粗体,每种字重都包含常规和斜体变体。字体以WOFF2、WOFF和TrueType格式从《卫报》服务器加载,以确保在不同浏览器中的兼容性。
@font-face {
font-family: Guardian Headline Full;
src: url(https://assets.guim.co.uk/static/frontend/fonts/guardian-headline/noalts-not-hinted/GHGuardianHeadline-Bold.woff2) format("woff2"),
url(https://assets.guim.co.uk/static/frontend/fonts/guardian-headline/noalts-not-hinted/GHGuardianHeadline-Bold.woff) format("woff"),
url(https://assets.guim.co.uk/static/frontend/fonts/guardian-headline/noalts-not-hinted/GHGuardianHeadline-Bold.ttf) format("truetype");
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: Guardian Headline Full;
src: url(https://assets.guim.co.uk/static/frontend/fonts/guardian-headline/noalts-not-hinted/GHGuardianHeadline-BoldItalic.woff2) format("woff2"),
url(https://assets.guim.co.uk/static/frontend/fonts/guardian-headline/noalts-not-hinted/GHGuardianHeadline-BoldItalic.woff) format("woff"),
url(https://assets.guim.co.uk/static/frontend/fonts/guardian-headline/noalts-not-hinted/GHGuardianHeadline-BoldItalic.ttf) format("truetype");
font-weight: 700;
font-style: italic;
}
@font-face {
font-family: Guardian Headline Full;
src: url(https://assets.guim.co.uk/static/frontend/fonts/guardian-headline/noalts-not-hinted/GHGuardianHeadline-Black.woff2) format("woff2"),
url(https://assets.guim.co.uk/static/frontend/fonts/guardian-headline/noalts-not-hinted/GHGuardianHeadline-Black.woff) format("woff"),
url(https://assets.guim.co.uk/static/frontend/fonts/guardian-headline/noalts-not-hinted/GHGuardianHeadline-Black.ttf) format("truetype");
font-weight: 900;
font-style: normal;
}
@font-face {
font-family: Guardian Headline Full;
src: url(https://assets.guim.co.uk/static/frontend/fonts/guardian-headline/noalts-not-hinted/GHGuardianHeadline-BlackItalic.woff2) format("woff2"),
url(https://assets.guim.co.uk/static/frontend/fonts/guardian-headline/noalts-not-hinted/GHGuardianHeadline-BlackItalic.woff) format("woff"),
url(https://assets.guim.co.uk/static/frontend/fonts/guardian-headline/noalts-not-hinted/GHGuardianHeadline-BlackItalic.ttf) format("truetype");
font-weight: 900;
font-style: italic;
}
@font-face {
font-family: Guardian Titlepiece;
src: url(https://assets.guim.co.uk/static/frontend/fonts/guardian-titlepiece/noalts-not-hinted/GTGuardianTitlepiece-Bold.woff2) format("woff2"),
url(https://assets.guim.co.uk/static/frontend/fonts/guardian-titlepiece/noalts-not-hinted/GTGuardianTitlepiece-Bold.woff) format("woff"),
url(https://assets.guim.co.uk/static/frontend/fonts/guardian-titlepiece/noalts-not-hinted/GTGuardianTitlepiece-Bold.ttf) format("truetype");
font-weight: 700;
font-style: normal;
}
@media (min-width: 71.25em) {
.content__main-column--interactive {
margin-left: 160px;
}
}
@media (min-width: 81.25em) {
.content__main-column--interactive {
margin-left: 240px;
}
}
.content__main-column--interactive .element-atom {
max-width: 620px;
}
@media (max-width: 46.24em) {
.content__main-column--interactive .element-atom {
max-width: 100%;
}
}
.content__main-column--interactive .element-showcase {
margin-left: 0;
}
@media (min-width: 46.25em) {
.content__main-column--interactive .element-showcase {
max-width: 620px;
}
}
@media (min-width: 71.25em) {
.content__main-column--interactive .element-showcase {
max-width: 860px;
}
}
.content__main-column--interactive .element-immersive {
max-width: 1100px;
}
@media (max-width: 46.24em) {
.content__main-column--interactive .element-immersive {
width: calc(100vw - var(--scrollbar-width, 0px));
position: relative;
left: 50%;
right: 50%;
margin-left: calc(-50vw + var(--half-scrollbar-width, 0px)) !important;
margin-right: calc(-50vw + var(--half-scrollbar-width, 0px)) !important;
}
}
@media (min-width: 46.25em) {
.content__main-column--interactive .element-immersive {
transform: translate(-20px);
width: calc(100% + 60px);
}
}
@media (max-width: 71.24em) {
.content__main-column--interactive .element-immersive {
margin-left: 0;
margin-right: 0;
}
}
@media (min-width: 71.25em) {
.content__main-column--interactive .element-immersive {
transform: translate(0);
width: auto;
}
}
@media (min-width: 81.25em) {
.content__main-column--interactive .element-immersive {
max-width: 1260px;
}
}
.content__main-column--interactive p,
.content__main-column--interactive ul {
max-width: 620px;
}
.content__main-column--interactive:before {
position: absolute;
top: 0;
height: calc(100% + 15px);
min-height: 100px;
content: "";
}
@media (min-width: 71.25em) {
}.content__main-column--interactive:before {
border-left: 1px solid #dcdcdc;
z-index: -1;
left: -10px;
}
@media (min-width: 81.25em) {
.content__main-column--interactive:before {
border-left: 1px solid #dcdcdc;
left: -11px;
}
}
.content__main-column--interactive .element-atom {
margin-top: 0;
margin-bottom: 0;
padding-bottom: 12px;
padding-top: 12px;
}
.content__main-column--interactive p + .element-atom {
padding-top: 0;
padding-bottom: 0;
margin-top: 12px;
margin-bottom: 12px;
}
.content__main-column--interactive .element-inline {
max-width: 620px;
}
@media (min-width: 61.25em) {
figure[data-spacefinder-role="inline"].element {
max-width: 620px;
}
}
:root {
--dateline: #606060;
--headerBorder: #dcdcdc;
--captionText: #999;
--captionBackground: hsla(0, 0%, 7%, 0.72);
--feature: #c70000;
--new-pillar-colour: var(--primary-pillar, var(--feature));
}
:root:root {
--subheading-text: var(--secondary-pillar);
--pullquote-text: var(--secondary-pillar);
--pullquote-icon: var(--secondary-pillar);
--block-quote-text: var(--article-text);
}
:root:root blockquote {
--block-quote-fill: var(--secondary-pillar);
}
@media (prefers-color-scheme: dark) {
:root:root:not([data-color-scheme="light"]) {
--subheading-text: var(--darkmode-pillar);
--pullquote-text: var(--darkmode-pillar);
--pullquote-icon: var(--darkmode-pillar);
}
:root:root:not([data-color-scheme="light"]) blockquote {
--block-quote-fill: var(--darkmode-pillar);
}
}
.content__main-column--interactive .element.element-atom,
.element.element-atom {
padding: 0;
}
#article-body > div .element-atom:first-of-type + p:first-of-type,
#article-body > div .element-atom:first-of-type + .sign-in-gate + p:first-of-type,
#article-body > div .element-atom:first-of-type + #sign-in-gate + p:first-of-type,
#article-body > div hr:not(.last-horizontal-rule) + p,
.content--interactive > div .element-atom:first-of-type + p:first-of-type,
.content--interactive > div .element-atom:first-of-type + .sign-in-gate + p:first-of-type,
.content--interactive > div .element-atom:first-of-type + #sign-in-gate + p:first-of-type,
.content--interactive > div hr:not(.last-horizontal-rule) + p,
#comment-body .element-atom:first-of-type + p:first-of-type,
#comment-body .element-atom:first-of-type + .sign-in-gate + p:first-of-type,
#comment-body .element-atom:first-of-type + #sign-in-gate + p:first-of-type,
#comment-body hr:not(.last-horizontal-rule) + p,
[data-gu-name="body"] .element-atom:first-of-type + p:first-of-type,
[data-gu-name="body"] .element-atom:first-of-type + .sign-in-gate + p:first-of-type,
[data-gu-name="body"] .element-atom:first-of-type + #sign-in-gate + p:first-of-type,
[data-gu-name="body"] hr:not(.last-horizontal-rule) + p,
#feature-body .element-atom:first-of-type + p:first-of-type,
#feature-body .element-atom:first-of-type + .sign-in-gate + p:first-of-type,
#feature-body .element-atom:first-of-type + #sign-in-gate + p:first-of-type,
#feature-body hr:not(.last-horizontal-rule) + p {
padding-top: 14px;
}
#article-body > div .element-atom:first-of-type + p:first-of-type:first-letter,
#article-body > div .element-atom:first-of-type + .sign-in-gate + p:first-of-type:first-letter,
#article-body > div .element-atom:first-of-type + #sign-in-gate + p:first-of-type:first-letter,
#article-body > div hr:not(.last-horizontal-rule) + p:first-letter,
.content--interactive > div .element-atom:first-of-type + p:first-of-type:first-letter,
.content--interactive > div .element-atom:first-of-type + .sign-in-gate + p:first-of-type:first-letter,
.content--interactive > div .element-atom:first-of-type + #sign-in-gate + p:first-of-type:first-letter,
.content--interactive > div hr:not(.last-horizontal-rule) + p:first-letter,
#comment-body .element-atom:first-of-type + p:first-of-type:first-letter,
#comment-body .element-atom:first-of-type + .sign-in-gate + p:first-of-type:first-letter,
#comment-body .element-atom:first-of-type + #sign-in-gate + p:first-of-type:first-letter,
#comment-body hr:not(.last-horizontal-rule) + p:first-letter,
[data-gu-name="body"] .element-atom:first-of-type + p:first-of-type:first-letter,
[data-gu-name="body"] .element-atom:first-of-type + .sign-in-gate + p:first-of-type:first-letter,
[data-gu-name="body"] .element-atom:first-of-type + #sign-in-gate + p:first-of-type:first-letter,
[data-gu-name="body"] hr:not(.last-horizontal-rule) + p:first-letter,
#feature-body .element-atom:first-of-type + p:first-of-type:first-letter,文章正文第一段的首字母使用特定的标题字体,加粗、放大、左浮动、大写并着色。水平线后的段落没有上内边距。引文宽度限制为620像素。
展示元素的标题正常定位,最大宽度为620像素。沉浸式元素横跨整个视口宽度,在不同屏幕尺寸上调整其最大宽度和标题内边距。在非常小的屏幕上,它们向左边缘对齐。
对于较大屏幕,文章标题使用网格布局。标题有上边框,元信息定位时带有较小的上内边距,导语链接使用自定义颜色下划线,而不是有下边框。
对于最小宽度为61.25em的屏幕,导语元素内的第一段将有上边框且无下内边距。如果屏幕宽度也至少为71.25em,则此上边框被移除。
在宽度至少为61.25em的屏幕上,家具包装器内的图片没有左外边距,具有特定角色的内联图片最大宽度为630px。
对于宽度至少为71.25em的屏幕,家具包装器使用具有定义列和行的网格布局。元元素前出现装饰线,导语段落失去上边框。在导语内容前添加垂直线。
对于宽度至少为81.25em的屏幕,网格布局调整其列和行。元元素前的装饰线变宽,导语前的垂直线略微移动。
标题具有最大宽度和字体大小,这些在较大屏幕尺寸下会改变。某些关键线在较大屏幕上隐藏,社交和评论元素使用边框颜色变量。一些元容器元素不显示。
导语部分具有负的左外边距和相对定位,在中等屏幕上调整内边距。其段落具有特定的字体属性。
主媒体区域相对定位,无上外边距,有较小的下外边距,并放置在"portrait"网格区域。
CSS代码为各种元素设置样式。家具包装器类内的媒体元素设置为全宽,无水平外边距。在较大屏幕(超过61.25em)上,这些媒体部分无下外边距。在较小屏幕(低于46.24em)上,它们横跨整个视口宽度,考虑滚动条,左外边距为-10px。对于中等小屏幕(30em至46.24em之间),左外边距为-20px。
图片标题绝对定位在底部,具有特定的内边距、背景和文本颜色。标题内的第一个span被隐藏,而第二个显示并限制为90%宽度。在宽度超过30em的屏幕上,标题内边距增加。具有"hidden"类的标题不可见。
标题按钮定位在右下角,样式为圆形背景和缩放图标。在超过30em的屏幕上,它略微向右移动。
对于超大屏幕(超过71.25em)上的交互式内容列,伪元素调整位置和高度。这些列内的标题限制为620px宽度。
为深色背景和特色颜色定义颜色变量,并在深色模式下为iOS和Android设备进行调整。在iOS和Android上,文章容器中特定元素后的第一段首字母使用次要支柱颜色样式。这些平台上的文章标题也接收特定样式。
对于Android设备,将评论文章的文章标题高度设置为零。
对于iOS和Android设备,在特色、标准和评论文章中为家具包装器应用内边距。
对于iOS和Android设备,为特色、标准和评论文章中家具包装器的内容标签设置样式,使用粗体字体、特定字体族、自定义颜色变量,并将文本大写。
对于iOS和Android设备,为特色、标准和评论文章中家具包装器的主标题设置样式,字体大小为32px,字重为粗体,下内边距为12px,颜色为深灰色。
对于iOS和Android设备,定位和调整特色、标准和评论文章中家具包装器的图片尺寸,将其宽度设置为相对于视口。
对于iOS和Android设备,确保这些图片内的内部元素、图片和链接具有透明背景和与视口匹配的宽度。
对于iOS和Android设备,为特色、标准和评论文章中家具包装器的导语文本设置样式。
CSS代码为文章容器设置样式。导语部分具有上下内边距,以及负的右外边距。在iOS和Android设备上,内部文本使用特定的字体族。此部分内的链接使用自定义属性的颜色样式,下划线带有偏移,并且悬停时边框颜色改变。元部分无外边距,署名和作者链接等元素继承这些样式。
对于iOS和Android设备,文章署名中的作者姓名应以指定的支柱颜色显示。此外,移除元信息部分的任何内边距,并确保其中的任何SVG图标使用相同的支柱颜色作为描边。
对于展示元素,标题按钮应为弹性容器,居中显示,内边距为5px,定位在距右边缘14px处,尺寸为28px×28px。
文章主体应具有12px的水平内边距。文章主体内的标准图片元素(不包括缩略图和沉浸式图片)应横跨整个可用宽度(考虑内边距和滚动条),无外边距并保持其宽高比。此样式也适用于这些图片的标题。
对于iOS和Android设备,移除特色、标准和评论文章中图片标题的内边距,缩略图和沉浸式图片除外。使沉浸式图片横跨整个视口宽度,考虑滚动条。
使用新的支柱颜色为引用的文本设置带颜色标记的样式。使用主要支柱颜色、下划线和特定偏移格式化链接