@reuters-graphics/graphics-components 0.0.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/@types/actions/cssVariables/index.d.ts +4 -0
- package/dist/@types/actions/resizeObserver/index.d.ts +4 -0
- package/dist/@types/components/@types/global.d.ts +28 -0
- package/dist/@types/components/Article/Article.svelte.d.ts +32 -0
- package/dist/@types/components/BeforeAfter/BeforeAfter.svelte.d.ts +57 -0
- package/dist/@types/components/Block/Block.svelte.d.ts +24 -0
- package/dist/@types/components/BodyText/BodyText.svelte.d.ts +20 -0
- package/dist/@types/components/DatawrapperChart/DatawrapperChart.svelte.d.ts +52 -0
- package/dist/@types/components/EmbedPreviewerLink/EmbedPreviewerLink.svelte.d.ts +16 -0
- package/dist/@types/components/FeaturePhoto/FeaturePhoto.svelte.d.ts +43 -0
- package/dist/@types/components/Framer/Framer.svelte.d.ts +29 -0
- package/dist/@types/components/Framer/Resizer/index.svelte.d.ts +27 -0
- package/dist/@types/components/Framer/stores.d.ts +1 -0
- package/dist/@types/components/Framer/uniqNames.d.ts +2 -0
- package/dist/@types/components/GraphicBlock/AriaHidden.svelte.d.ts +20 -0
- package/dist/@types/components/GraphicBlock/GraphicBlock.svelte.d.ts +64 -0
- package/dist/@types/components/GraphicBlock/TextBlock.svelte.d.ts +19 -0
- package/dist/@types/components/Headline/Headline.svelte.d.ts +29 -0
- package/dist/@types/components/Hero/Hero.svelte.d.ts +41 -0
- package/dist/@types/components/NoteText/NoteText.svelte.d.ts +20 -0
- package/dist/@types/components/PaddingReset/index.svelte.d.ts +27 -0
- package/dist/@types/components/PhotoPack/PhotoPack.svelte.d.ts +50 -0
- package/dist/@types/components/PhotoPack/docProps.d.ts +38 -0
- package/dist/@types/components/PymChild/PymChild.svelte.d.ts +16 -0
- package/dist/@types/components/ReutersLogo/ReutersLogo.svelte.d.ts +18 -0
- package/dist/@types/components/SEO/SEO.svelte.d.ts +66 -0
- package/dist/@types/components/SEO/analytics.d.ts +2 -0
- package/dist/@types/components/SEO/publisherTags.d.ts +2 -0
- package/dist/@types/components/Scroller/Background.svelte.d.ts +20 -0
- package/dist/@types/components/Scroller/Embedded/Background.svelte.d.ts +19 -0
- package/dist/@types/components/Scroller/Embedded/Foreground.svelte.d.ts +18 -0
- package/dist/@types/components/Scroller/Embedded/index.svelte.d.ts +19 -0
- package/dist/@types/components/Scroller/Foreground.svelte.d.ts +17 -0
- package/dist/@types/components/Scroller/Scroller.svelte.d.ts +76 -0
- package/dist/@types/components/Sharer/Sharer.svelte.d.ts +19 -0
- package/dist/@types/components/Sharer/utils/copyToClipboard.d.ts +2 -0
- package/dist/@types/components/Sharer/utils/facebook.d.ts +2 -0
- package/dist/@types/components/Sharer/utils/meta.d.ts +2 -0
- package/dist/@types/components/Sharer/utils/twitter.d.ts +2 -0
- package/dist/@types/components/SiteFooter/CompanyLinks.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/LegalLinks.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/QuickLinks.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/Referrals/IntersectionObserver.svelte.d.ts +39 -0
- package/dist/@types/components/SiteFooter/Referrals/Link.svelte.d.ts +29 -0
- package/dist/@types/components/SiteFooter/Referrals/Referrals.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/Referrals/index.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/SiteFooter.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/svgs/Facebook.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/svgs/Graphics.svelte.d.ts +19 -0
- package/dist/@types/components/SiteFooter/svgs/Instagram.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/svgs/LinkedIn.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/svgs/Pictures.svelte.d.ts +19 -0
- package/dist/@types/components/SiteFooter/svgs/Twitter.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/svgs/Videos.svelte.d.ts +19 -0
- package/dist/@types/components/SiteFooter/svgs/YouTube.svelte.d.ts +23 -0
- package/dist/@types/components/SiteHeader/MobileMenu/index.svelte.d.ts +27 -0
- package/dist/@types/components/SiteHeader/NavBar/DownArrow.svelte.d.ts +23 -0
- package/dist/@types/components/SiteHeader/NavBar/NavDropdown/MoreDropdown.svelte.d.ts +23 -0
- package/dist/@types/components/SiteHeader/NavBar/NavDropdown/SectionDropdown.svelte.d.ts +25 -0
- package/dist/@types/components/SiteHeader/NavBar/NavDropdown/Spinner/index.svelte.d.ts +19 -0
- package/dist/@types/components/SiteHeader/NavBar/NavDropdown/StoryCard/index.svelte.d.ts +25 -0
- package/dist/@types/components/SiteHeader/NavBar/NavDropdown/StoryCard/time.d.ts +1 -0
- package/dist/@types/components/SiteHeader/NavBar/NavDropdown/index.svelte.d.ts +27 -0
- package/dist/@types/components/SiteHeader/NavBar/index.svelte.d.ts +23 -0
- package/dist/@types/components/SiteHeader/NavBar/utils/index.d.ts +1 -0
- package/dist/@types/components/SiteHeader/SiteHeader.svelte.d.ts +14 -0
- package/dist/@types/components/SiteHeader/svgs/Close.svelte.d.ts +19 -0
- package/dist/@types/components/SiteHeader/svgs/Menu.svelte.d.ts +23 -0
- package/dist/@types/components/Spinner/Spinner.svelte.d.ts +28 -0
- package/dist/@types/components/Theme/@types/component.d.ts +28 -0
- package/dist/@types/components/Theme/Theme.svelte.d.ts +54 -0
- package/dist/@types/components/Theme/themes/dark.d.ts +2 -0
- package/dist/@types/components/Theme/themes/light.d.ts +22 -0
- package/dist/@types/components/Theme/utils/flatten.d.ts +1 -0
- package/dist/@types/components/Theme/utils/merge.d.ts +4 -0
- package/dist/@types/components/Video/Controls.svelte.d.ts +45 -0
- package/dist/@types/components/Video/Video.svelte.d.ts +46 -0
- package/dist/@types/components/Visible/Visible.svelte.d.ts +29 -0
- package/dist/@types/index.d.ts +24 -0
- package/dist/actions/cssVariables/index.js +20 -0
- package/dist/actions/resizeObserver/index.js +25 -0
- package/dist/components/@types/global.js +1 -0
- package/dist/components/Article/Article.svelte +47 -0
- package/dist/components/BeforeAfter/BeforeAfter.svelte +341 -0
- package/dist/components/Block/Block.svelte +177 -0
- package/dist/components/BodyText/BodyText.svelte +193 -0
- package/dist/components/DatawrapperChart/DatawrapperChart.svelte +105 -0
- package/dist/components/EmbedPreviewerLink/EmbedPreviewerLink.svelte +26 -0
- package/dist/components/FeaturePhoto/FeaturePhoto.svelte +113 -0
- package/dist/components/Framer/Framer.svelte +136 -0
- package/dist/components/Framer/Resizer/index.svelte +223 -0
- package/dist/components/Framer/stores.js +3 -0
- package/dist/components/Framer/uniqNames.js +54 -0
- package/dist/components/GraphicBlock/AriaHidden.svelte +13 -0
- package/dist/components/GraphicBlock/GraphicBlock.svelte +269 -0
- package/dist/components/GraphicBlock/TextBlock.svelte +12 -0
- package/dist/components/Headline/Headline.svelte +109 -0
- package/dist/components/Hero/Hero.svelte +78 -0
- package/dist/components/NoteText/NoteText.svelte +124 -0
- package/dist/components/PaddingReset/index.svelte +17 -0
- package/dist/components/PhotoPack/PhotoPack.svelte +156 -0
- package/dist/components/PhotoPack/docProps.js +20 -0
- package/dist/components/PymChild/PymChild.svelte +10 -0
- package/dist/components/ReutersLogo/ReutersLogo.svelte +21 -0
- package/dist/components/SEO/SEO.svelte +179 -0
- package/dist/components/SEO/analytics.js +332 -0
- package/dist/components/SEO/publisherTags.js +26 -0
- package/dist/components/Scroller/Background.svelte +30 -0
- package/dist/components/Scroller/Embedded/Background.svelte +14 -0
- package/dist/components/Scroller/Embedded/Foreground.svelte +203 -0
- package/dist/components/Scroller/Embedded/index.svelte +18 -0
- package/dist/components/Scroller/Foreground.svelte +42 -0
- package/dist/components/Scroller/Scroller.svelte +210 -0
- package/dist/components/Sharer/Sharer.svelte +157 -0
- package/dist/components/Sharer/utils/copyToClipboard.js +10 -0
- package/dist/components/Sharer/utils/facebook.js +22 -0
- package/dist/components/Sharer/utils/meta.js +7 -0
- package/dist/components/Sharer/utils/twitter.js +22 -0
- package/dist/components/SiteFooter/CompanyLinks.svelte +173 -0
- package/dist/components/SiteFooter/LegalLinks.svelte +202 -0
- package/dist/components/SiteFooter/QuickLinks.svelte +259 -0
- package/dist/components/SiteFooter/Referrals/IntersectionObserver.svelte +45 -0
- package/dist/components/SiteFooter/Referrals/Link.svelte +73 -0
- package/dist/components/SiteFooter/Referrals/Referrals.svelte +56 -0
- package/dist/components/SiteFooter/Referrals/index.svelte +53 -0
- package/dist/components/SiteFooter/SiteFooter.svelte +41 -0
- package/dist/components/SiteFooter/data.json +210 -0
- package/dist/components/SiteFooter/svgs/Facebook.svelte +18 -0
- package/dist/components/SiteFooter/svgs/Graphics.svelte +18 -0
- package/dist/components/SiteFooter/svgs/Instagram.svelte +20 -0
- package/dist/components/SiteFooter/svgs/LinkedIn.svelte +18 -0
- package/dist/components/SiteFooter/svgs/Pictures.svelte +14 -0
- package/dist/components/SiteFooter/svgs/Twitter.svelte +18 -0
- package/dist/components/SiteFooter/svgs/Videos.svelte +14 -0
- package/dist/components/SiteFooter/svgs/YouTube.svelte +18 -0
- package/dist/components/SiteHeader/MobileMenu/index.svelte +199 -0
- package/dist/components/SiteHeader/NavBar/DownArrow.svelte +26 -0
- package/dist/components/SiteHeader/NavBar/NavDropdown/MoreDropdown.svelte +112 -0
- package/dist/components/SiteHeader/NavBar/NavDropdown/SectionDropdown.svelte +118 -0
- package/dist/components/SiteHeader/NavBar/NavDropdown/Spinner/index.svelte +49 -0
- package/dist/components/SiteHeader/NavBar/NavDropdown/StoryCard/index.svelte +99 -0
- package/dist/components/SiteHeader/NavBar/NavDropdown/StoryCard/time.js +70 -0
- package/dist/components/SiteHeader/NavBar/NavDropdown/index.svelte +277 -0
- package/dist/components/SiteHeader/NavBar/index.svelte +234 -0
- package/dist/components/SiteHeader/NavBar/utils/index.js +2 -0
- package/dist/components/SiteHeader/SiteHeader.svelte +235 -0
- package/dist/components/SiteHeader/data.json +1 -0
- package/dist/components/SiteHeader/scss/_breakpoints.scss +59 -0
- package/dist/components/SiteHeader/scss/_colors.scss +25 -0
- package/dist/components/SiteHeader/scss/_eases.scss +9 -0
- package/dist/components/SiteHeader/scss/_grids.scss +126 -0
- package/dist/components/SiteHeader/scss/_z-indexes.scss +15 -0
- package/dist/components/SiteHeader/svgs/Close.svelte +14 -0
- package/dist/components/SiteHeader/svgs/Menu.svelte +19 -0
- package/dist/components/Spinner/Spinner.svelte +91 -0
- package/dist/components/Theme/@types/component.js +3 -0
- package/dist/components/Theme/Theme.svelte +37 -0
- package/dist/components/Theme/themes/dark.js +23 -0
- package/dist/components/Theme/themes/light.js +22 -0
- package/dist/components/Theme/utils/flatten.js +39 -0
- package/dist/components/Theme/utils/merge.js +23 -0
- package/dist/components/Video/Controls.svelte +68 -0
- package/dist/components/Video/Video.svelte +278 -0
- package/dist/components/Visible/Visible.svelte +54 -0
- package/dist/index.js +31 -0
- package/dist/scss/_mixins.scss +6 -0
- package/dist/scss/_variables.scss +2 -0
- package/dist/scss/bootstrap/_main.scss +34 -0
- package/dist/scss/bootstrap/_variables.scss +10 -0
- package/dist/scss/colours/thematic/_nord.scss +40 -0
- package/dist/scss/colours/thematic/_tr.scss +27 -0
- package/dist/scss/components/_hero-title.scss +118 -0
- package/dist/scss/fonts/_font-faces.scss +129 -0
- package/dist/scss/fonts/_mixins.scss +25 -0
- package/dist/scss/fonts/_rules.scss +19 -0
- package/dist/scss/fonts/_variables.scss +26 -0
- package/dist/scss/main.scss +16 -0
- package/dist/scss/mixins/_block.scss +62 -0
- package/dist/scss/mixins/_body-text.scss +113 -0
- package/dist/scss/mixins/_graphic.scss +66 -0
- package/dist/scss/mixins/_note-text.scss +34 -0
- package/dist/scss/mixins/_visually-hidden.scss +12 -0
- package/dist/scss/spacers/_rules.scss +65 -0
- package/dist/scss/spacers/_variables.scss +19 -0
- package/dist/scss/typography/_box-shadow.scss +11 -0
- package/dist/scss/typography/_font-size.scss +81 -0
- package/dist/scss/typography/_letter-spacing.scss +15 -0
- package/dist/scss/typography/_main.scss +5 -0
- package/dist/scss/typography/_mixins.scss +26 -0
- package/dist/scss/typography/_rules.scss +83 -0
- package/dist/scss/typography/_text-shadow.scss +13 -0
- package/dist/scss/typography/_transform.scss +7 -0
- package/dist/scss/typography/_variables.scss +39 -0
- package/package.json +210 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
<script>import { ReutersLogo } from '../../index.js';
|
|
2
|
+
import NavBar from './NavBar/index.svelte';
|
|
3
|
+
import data from './data.json';
|
|
4
|
+
import { setContext } from 'svelte';
|
|
5
|
+
import { writable } from 'svelte/store';
|
|
6
|
+
import MenuIcon from './svgs/Menu.svelte';
|
|
7
|
+
import MobileMenu from './MobileMenu/index.svelte';
|
|
8
|
+
setContext('nav-active-section', writable(null));
|
|
9
|
+
const { sections } = data[0];
|
|
10
|
+
let isMobileMenuOpen = false;
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<header
|
|
14
|
+
style="{`
|
|
15
|
+
--nav-background: var(--theme-colour-background, #fff);
|
|
16
|
+
--nav-primary: var(--theme-colour-text-primary, #404040);
|
|
17
|
+
--nav-rules: var(--theme-colour-brand-rules, #d0d0d0);
|
|
18
|
+
--nav-accent: var(--theme-colour-brand-logo, #fa6400);
|
|
19
|
+
--nav-shadow: 0 1px 4px 2px var(--theme-colour-brand-shadow, rgb(255 255 255 / 10%));
|
|
20
|
+
`}"
|
|
21
|
+
>
|
|
22
|
+
<div class="nav-container show-nav">
|
|
23
|
+
<div class="scroll-container">
|
|
24
|
+
<div class="inner">
|
|
25
|
+
<div class="main-bar">
|
|
26
|
+
<div class="logo-container">
|
|
27
|
+
<div class="logo">
|
|
28
|
+
<a href="https://www.reuters.com">
|
|
29
|
+
<ReutersLogo
|
|
30
|
+
logoColour="var(--nav-accent)"
|
|
31
|
+
textColour="var(--nav-primary)"
|
|
32
|
+
/>
|
|
33
|
+
</a>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<NavBar sections="{sections}" />
|
|
37
|
+
<!-- Space takes the place of the MyViewMenu, NavSearchBar & Account components... -->
|
|
38
|
+
<div class="spacer-container">
|
|
39
|
+
<div class="spacer"></div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div class="mobile-button-group">
|
|
43
|
+
<div class="mobile-menu">
|
|
44
|
+
<button
|
|
45
|
+
class="menu-button"
|
|
46
|
+
aria-label="Menu"
|
|
47
|
+
aria-haspopup="true"
|
|
48
|
+
aria-expanded="{isMobileMenuOpen}"
|
|
49
|
+
on:click="{() => {
|
|
50
|
+
isMobileMenuOpen = !isMobileMenuOpen;
|
|
51
|
+
}}"
|
|
52
|
+
>
|
|
53
|
+
<div class="button-container">
|
|
54
|
+
<MenuIcon />
|
|
55
|
+
</div>
|
|
56
|
+
</button>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</header>
|
|
64
|
+
|
|
65
|
+
<MobileMenu
|
|
66
|
+
isMobileMenuOpen="{isMobileMenuOpen}"
|
|
67
|
+
releaseMobileMenu="{() => {
|
|
68
|
+
isMobileMenuOpen = false;
|
|
69
|
+
}}"
|
|
70
|
+
data="{data[0]}"
|
|
71
|
+
/>
|
|
72
|
+
|
|
73
|
+
<style>@charset "UTF-8";
|
|
74
|
+
/*
|
|
75
|
+
Several components utilize z-index, the CSS property that helps control layout by providing a third axis to arrange content. We utilize a default z-index scale that’s been designed to properly layer navigation, tooltips and popovers, modals, and more.
|
|
76
|
+
These higher values start at an arbitrary number, high and specific enough to ideally avoid conflicts. We need a standard set of these across our layered components—tooltips, popovers, navbars, dropdowns, modals—so we can be reasonably consistent in the behaviors.
|
|
77
|
+
To handle overlapping borders within components (e.g., buttons and inputs in input groups), we use low single digit z-index values of 1, 2, and 3 for default, hover, and active states. On hover/focus/active, we bring a particular element to the forefront with a higher z-index value to show their border over the sibling elements.
|
|
78
|
+
*/
|
|
79
|
+
.nav-container {
|
|
80
|
+
background-color: var(--nav-background, #fff);
|
|
81
|
+
position: relative;
|
|
82
|
+
height: 64px;
|
|
83
|
+
z-index: 1020;
|
|
84
|
+
--page-height: 0px;
|
|
85
|
+
}
|
|
86
|
+
@media (max-width: 1023px) {
|
|
87
|
+
.nav-container {
|
|
88
|
+
height: 56px;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
.nav-container a {
|
|
92
|
+
text-decoration: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.scroll-container {
|
|
96
|
+
height: calc(var(--page-height) - 50vh);
|
|
97
|
+
pointer-events: none;
|
|
98
|
+
}
|
|
99
|
+
.scroll-container .inner {
|
|
100
|
+
position: -webkit-sticky;
|
|
101
|
+
position: sticky;
|
|
102
|
+
top: 0;
|
|
103
|
+
background: var(--nav-background, #fff);
|
|
104
|
+
pointer-events: auto;
|
|
105
|
+
border-bottom: 1px solid var(--nav-rules, #d0d0d0);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.main-bar {
|
|
109
|
+
padding-left: 2.2222222222vw;
|
|
110
|
+
padding-right: 2.2222222222vw;
|
|
111
|
+
margin: 0 auto;
|
|
112
|
+
box-sizing: border-box;
|
|
113
|
+
display: flex;
|
|
114
|
+
height: 64px;
|
|
115
|
+
justify-content: space-between;
|
|
116
|
+
max-width: 1440px;
|
|
117
|
+
}
|
|
118
|
+
@media (max-width: 1023px) {
|
|
119
|
+
.main-bar {
|
|
120
|
+
padding-left: 4.2666666667vw;
|
|
121
|
+
padding-right: 4.2666666667vw;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
@media (min-width: 1440px) {
|
|
125
|
+
.main-bar {
|
|
126
|
+
padding-left: 32px;
|
|
127
|
+
padding-right: 32px;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
@media (max-width: 745px) {
|
|
131
|
+
.main-bar {
|
|
132
|
+
height: 56px;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.logo-container {
|
|
137
|
+
align-self: center;
|
|
138
|
+
}
|
|
139
|
+
.logo-container .logo {
|
|
140
|
+
display: block;
|
|
141
|
+
font-size: 0;
|
|
142
|
+
}
|
|
143
|
+
@media (max-width: 1023px) {
|
|
144
|
+
.logo-container .logo {
|
|
145
|
+
width: 127px;
|
|
146
|
+
min-width: 127px;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
@media (min-width: 1024px) {
|
|
150
|
+
.logo-container .logo {
|
|
151
|
+
width: 154px;
|
|
152
|
+
min-width: 154px;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
@media (min-width: 1300px) {
|
|
156
|
+
.logo-container .logo {
|
|
157
|
+
width: 184px;
|
|
158
|
+
min-width: 184px;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.spacer-container {
|
|
163
|
+
margin-left: auto;
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
justify-content: flex-end;
|
|
167
|
+
}
|
|
168
|
+
@media (max-width: 745px) {
|
|
169
|
+
.spacer-container {
|
|
170
|
+
display: none;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
.spacer-container .spacer {
|
|
174
|
+
width: 193.47px;
|
|
175
|
+
height: 64px;
|
|
176
|
+
}
|
|
177
|
+
@media (max-width: 1225px) {
|
|
178
|
+
.spacer-container .spacer {
|
|
179
|
+
width: 88px;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.mobile-button-group {
|
|
184
|
+
margin-left: auto;
|
|
185
|
+
display: flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
justify-content: flex-end;
|
|
188
|
+
}
|
|
189
|
+
@media (min-width: 746px) {
|
|
190
|
+
.mobile-button-group {
|
|
191
|
+
display: none;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.mobile-menu {
|
|
196
|
+
margin-left: 8px;
|
|
197
|
+
}
|
|
198
|
+
@media (min-width: 746px) {
|
|
199
|
+
.mobile-menu {
|
|
200
|
+
display: none;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
.mobile-menu .menu-button {
|
|
204
|
+
width: 40px;
|
|
205
|
+
height: 40px;
|
|
206
|
+
display: inline-block;
|
|
207
|
+
vertical-align: top;
|
|
208
|
+
outline: none;
|
|
209
|
+
border: none;
|
|
210
|
+
margin: 0;
|
|
211
|
+
padding: 0;
|
|
212
|
+
overflow: visible;
|
|
213
|
+
background: transparent;
|
|
214
|
+
color: inherit;
|
|
215
|
+
font: inherit;
|
|
216
|
+
line-height: normal;
|
|
217
|
+
}
|
|
218
|
+
.mobile-menu .menu-button .button-container {
|
|
219
|
+
border-radius: 8px;
|
|
220
|
+
position: relative;
|
|
221
|
+
overflow: hidden;
|
|
222
|
+
display: flex;
|
|
223
|
+
align-items: center;
|
|
224
|
+
justify-content: center;
|
|
225
|
+
width: 100%;
|
|
226
|
+
height: 100%;
|
|
227
|
+
box-sizing: border-box;
|
|
228
|
+
border: 2px solid var(--nav-background);
|
|
229
|
+
}
|
|
230
|
+
.mobile-menu .menu-button:hover .button-container {
|
|
231
|
+
box-shadow: var(--nav-shadow);
|
|
232
|
+
}
|
|
233
|
+
.mobile-menu .menu-button:focus-visible .button-container {
|
|
234
|
+
border: 2px solid var(--nav-accent);
|
|
235
|
+
}</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"sections":[{"id":"/world/","url":"/world/","name":"World","type":"section","children":[{"id":"/world/africa/","url":"/world/africa/","name":"Africa"},{"id":"/world/americas/","url":"/world/americas/","name":"Americas"},{"id":"/world/asia-pacific/","url":"/world/asia-pacific/","name":"Asia Pacific"},{"id":"/world/china/","url":"/world/china/","name":"China"},{"id":"/world/europe/","url":"/world/europe/","name":"Europe"},{"id":"/world/india/","url":"/world/india/","name":"India"},{"id":"/world/middle-east/","url":"/world/middle-east/","name":"Middle East"},{"id":"/world/uk/","url":"/world/uk/","name":"United Kingdom"},{"id":"/world/us/","url":"/world/us/","name":"United States"},{"id":"/world/the-great-reboot/","url":"/world/the-great-reboot/","name":"The Great Reboot"},{"id":"/world/reuters-next/","url":"/world/reuters-next/","name":"Reuters Next"}]},{"id":"/business/","url":"/business/","name":"Business","type":"section","children":[{"id":"/business/aerospace-defense/","url":"/business/aerospace-defense/","name":"Aerospace & Defense"},{"id":"/business/autos-transportation/","url":"/business/autos-transportation/","name":"Autos & Transportation"},{"id":"/business/energy/","url":"/business/energy/","name":"Energy"},{"id":"/business/environment/","url":"/business/environment/","name":"Environment"},{"id":"/business/finance/","url":"/business/finance/","name":"Finance"},{"id":"/business/healthcare-pharmaceuticals/","url":"/business/healthcare-pharmaceuticals/","name":"Healthcare & Pharmaceuticals"},{"id":"/business/media-telecom/","url":"/business/media-telecom/","name":"Media & Telecom"},{"id":"/business/retail-consumer/","url":"/business/retail-consumer/","name":"Retail & Consumer"},{"id":"/business/sustainable-business/","url":"/business/sustainable-business/","name":"Sustainable Business"},{"id":"/business/charged/","url":"/business/charged/","name":"Charged"},{"id":"/business/future-of-health/","url":"/business/future-of-health/","name":"Future of Health"},{"id":"/business/future-of-money/","url":"/business/future-of-money/","name":"Future of Money"},{"id":"/business/take-five/","url":"/business/take-five/","name":"Take Five"},{"id":"/business/reuters-impact/","url":"/business/reuters-impact/","name":"Reuters Impact"},{"id":"/business/davos/","url":"/business/davos/","name":"Davos"}]},{"id":"/legal/","url":"/legal/","name":"Legal","type":"section","children":[{"id":"/legal/government/","url":"/legal/government/","name":"Government"},{"id":"/legal/legalindustry/","url":"/legal/legalindustry/","name":"Legal Industry"},{"id":"/legal/litigation/","url":"/legal/litigation/","name":"Litigation"},{"id":"/legal/transactional/","url":"/legal/transactional/","name":"Transactional"}]},{"id":"/markets/","url":"/markets/","name":"Markets","type":"section","children":[{"id":"/markets/asia/","url":"/markets/asia/","name":"Asian Markets"},{"id":"/markets/carbon/","url":"/markets/carbon/","name":"Carbon Markets"},{"id":"/markets/commodities/","url":"/markets/commodities/","name":"Commodities"},{"id":"/markets/currencies/","url":"/markets/currencies/","name":"Currencies"},{"id":"/markets/deals/","url":"/markets/deals/","name":"Deals"},{"id":"/markets/emerging/","url":"/markets/emerging/","name":"Emerging Markets"},{"id":"/markets/europe/","url":"/markets/europe/","name":"European Markets"},{"id":"/markets/funds/","url":"/markets/funds/","name":"Funds"},{"id":"/markets/global-market-data/","url":"/markets/global-market-data/","name":"Global Market Data"},{"id":"/markets/rates-bonds/","url":"/markets/rates-bonds/","name":"Rates & Bonds"},{"id":"/markets/stocks/","url":"/markets/stocks/","name":"Stocks"},{"id":"/markets/us/","url":"/markets/us/","name":"U.S. Markets"},{"id":"/markets/wealth/","url":"/markets/wealth/","name":"Wealth"},{"id":"/markets/macromatters/","url":"/markets/macromatters/","name":"Macro Matters"}]},{"id":"/breakingviews/","url":"/breakingviews/","name":"Breakingviews","type":"section"},{"id":"/technology/","url":"/technology/","name":"Technology","type":"section","children":[{"id":"/technology/disrupted/","url":"/technology/disrupted/","name":"Disrupted"},{"id":"/technology/reuters-momentum/","url":"/technology/reuters-momentum/","name":"Reuters Momentum"}]},{"id":"/investigates/","url":"https://www.reuters.com/investigates/","name":"Investigations","type":"link"},{"id":"/lifestyle/sports/","url":"/lifestyle/sports/","name":"Sports","type":"section","children":[{"id":"/lifestyle/sports/athletics/","url":"/lifestyle/sports/athletics/","name":"Athletics"},{"id":"/lifestyle/sports/cricket/","url":"/lifestyle/sports/cricket/","name":"Cricket"},{"id":"/lifestyle/sports/cycling/","url":"/lifestyle/sports/cycling/","name":"Cycling"},{"id":"/lifestyle/sports/golf/","url":"/lifestyle/sports/golf/","name":"Golf"},{"id":"/lifestyle/sports/motor-sports/","url":"/lifestyle/sports/motor-sports/","name":"Motor Sports"},{"id":"/lifestyle/sports/soccer/","url":"/lifestyle/sports/soccer/","name":"Soccer"},{"id":"/lifestyle/sports/tennis/","url":"/lifestyle/sports/tennis/","name":"Tennis"}]},{"id":"/lifestyle/","url":"/lifestyle/","name":"Lifestyle","type":"section","children":[{"id":"/lifestyle/oddly-enough/","url":"/lifestyle/oddly-enough/","name":"Oddly Enough"},{"id":"/lifestyle/science/","url":"/lifestyle/science/","name":"Science"}]},{"id":"/graphics/","url":"https://graphics.reuters.com/","name":"Graphics","type":"link"},{"id":"/pictures/","url":"/pictures/","name":"Pictures","type":"section"},{"id":"/video/","url":"/video/","name":"Video","type":"section"}],"home_url":"/","search_url":"/site-search/","sign_in_url":"/signin/","sign_up_url":"/signup/","subscribe_url":"","my_account_url":"/myaccount/","my_view_url":"/myview/all","following_url":"/myview/following-feed","saved_url":"/myview/saved"}]
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// From FSC:
|
|
2
|
+
// Our design layouts are based on 2 artboard sizes:
|
|
3
|
+
// 375px for small screens and 1440px for desktop.
|
|
4
|
+
|
|
5
|
+
// However, these are snapshots to inform the core layouts.
|
|
6
|
+
// Some aspects of the design system adapt to breakpoints between these sizes.
|
|
7
|
+
|
|
8
|
+
// Our design layouts therefore show the snapshots for mobile on the 375px artboard and wide on the 1440px artboard.
|
|
9
|
+
|
|
10
|
+
// Note that if we refer only to desktop it means all layouts above 1023px, similarly mobile in general is below 1024px.
|
|
11
|
+
|
|
12
|
+
// Note that the desktop breakpoint kicks-in at 1024px, which also accommodates iPad/tablet in landscape.
|
|
13
|
+
// This is the last size before the layout adapts to the mobile view.
|
|
14
|
+
|
|
15
|
+
$maxWidth: 1440px;
|
|
16
|
+
|
|
17
|
+
@mixin for-small-mobile {
|
|
18
|
+
@media (max-width: 518px) { @content; }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@mixin for-mobile {
|
|
22
|
+
@media (max-width: 745px) { @content; }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@mixin for-tablet {
|
|
26
|
+
@media (min-width: 746px) and (max-width: 1023px) { @content; }
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@mixin for-tablet-up {
|
|
30
|
+
@media (min-width: 746px) { @content; }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@mixin for-tablet-down {
|
|
34
|
+
@media (max-width: 1023px) { @content; }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@mixin for-tight-desktop {
|
|
38
|
+
@media (min-width: 1024px) and (max-width: 1060px) { @content; }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@mixin for-desktop {
|
|
42
|
+
@media (min-width: 1024px) { @content; }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@mixin for-wide-desktop {
|
|
46
|
+
@media (min-width: 1300px) { @content; }
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@mixin for-extra-wide-desktop {
|
|
50
|
+
@media (min-width: 1440px) { @content; }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@mixin above-max {
|
|
54
|
+
@media (min-width: $maxWidth) { @content; }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@mixin max-width {
|
|
58
|
+
max-width: $maxWidth;
|
|
59
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Sheet of project colors
|
|
2
|
+
$tr-orange: #fa6400;
|
|
3
|
+
$tr-dark-orange: #dc4300;
|
|
4
|
+
$tr-light-orange: #ffa100;
|
|
5
|
+
$tr-dark-grey: #404040;
|
|
6
|
+
$tr-medium-grey: #666666;
|
|
7
|
+
$tr-light-grey: #afafaf;
|
|
8
|
+
$tr-muted-grey: #d0d0d0;
|
|
9
|
+
$tr-hover-background-grey: #f8f8f8;
|
|
10
|
+
$tr-light-muted-grey: #f4f4f4;
|
|
11
|
+
$tr-ultra-light-grey: #fafafa;
|
|
12
|
+
$tr-dark-blue: #005da2;
|
|
13
|
+
$tr-light-blue: #0099c4;
|
|
14
|
+
$tr-muted-blue: #4386B9;
|
|
15
|
+
$tr-lighter-blue: #7FACCE;
|
|
16
|
+
$tr-superlight-blue: #e5eef5;
|
|
17
|
+
$tr-dark-purple: #621f95;
|
|
18
|
+
$tr-light-purple: #6e3ab7;
|
|
19
|
+
$tr-dark-red: #a00000;
|
|
20
|
+
$tr-light-red: #dc0a0a;
|
|
21
|
+
$tr-dark-green: #387c2b;
|
|
22
|
+
$tr-light-green: #77a22d;
|
|
23
|
+
$black: #000;
|
|
24
|
+
$white: #fff;
|
|
25
|
+
$ad-placeholder: #ffb1b1;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
$principleDefaultEase: cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
2
|
+
$easeOutExpo: cubic-bezier(0.19, 1, 0.22, 1);
|
|
3
|
+
$easeOutCubic: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
4
|
+
$easeInOutCubic: cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
5
|
+
$easeInOutQuad: cubic-bezier(0.455, 0.03, 0.515, 0.955);
|
|
6
|
+
$easeInQuad: cubic-bezier(0.55, 0.085, 0.68, 0.53);
|
|
7
|
+
$easeOutQuad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
8
|
+
$navContainerEase: cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
9
|
+
$rtvDefaultEase: cubic-bezier(0.165, 0.84, 0.44, 1);
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
3
|
+
@import '_breakpoints.scss';
|
|
4
|
+
|
|
5
|
+
@mixin spacing-single($properties, $delta: 1) {
|
|
6
|
+
@each $property in $properties {
|
|
7
|
+
#{$property}: (math.div(32, 1440) * 100vw * $delta);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@include for-tablet-down {
|
|
11
|
+
@each $property in $properties {
|
|
12
|
+
#{$property}: (math.div(16, 375) * 100vw * $delta);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@include above-max {
|
|
17
|
+
@each $property in $properties {
|
|
18
|
+
#{$property}: (32px * $delta);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@mixin spacing-single-half($properties, $delta: 1) {
|
|
24
|
+
@each $property in $properties {
|
|
25
|
+
#{$property}: (calc(16 / 1440) * 100vw * $delta);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@include for-tablet-down {
|
|
29
|
+
@each $property in $properties {
|
|
30
|
+
#{$property}: (math.div(8, 375) * 100vw * $delta);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@include above-max {
|
|
35
|
+
@each $property in $properties {
|
|
36
|
+
#{$property}: (16px * $delta);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@mixin spacing-single-34($properties, $delta: 1) {
|
|
42
|
+
@each $property in $properties {
|
|
43
|
+
#{$property}: (math.div(24, 1440) * 100vw * $delta);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@include for-tablet-down {
|
|
47
|
+
@each $property in $properties {
|
|
48
|
+
#{$property}: (math.div(12, 375) * 100vw * $delta);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@include above-max {
|
|
53
|
+
@each $property in $properties {
|
|
54
|
+
#{$property}: (24px * $delta);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@mixin spacing-150($properties, $delta: 1) {
|
|
60
|
+
@each $property in $properties {
|
|
61
|
+
#{$property}: (math.div(48, 1440) * 100vw * $delta);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@include for-tablet-down {
|
|
65
|
+
@each $property in $properties {
|
|
66
|
+
#{$property}: (math.div(24, 375) * 100vw * $delta);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@include above-max {
|
|
71
|
+
@each $property in $properties {
|
|
72
|
+
#{$property}: (48px * $delta);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@mixin spacing-75($properties, $delta: 1) {
|
|
78
|
+
@each $property in $properties {
|
|
79
|
+
#{$property}: (math.div(24, 1440) * 100vw * $delta);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@include above-max {
|
|
83
|
+
@each $property in $properties {
|
|
84
|
+
#{$property}: (24px * $delta);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@mixin spacing-50($properties, $delta: 1) {
|
|
90
|
+
@each $property in $properties {
|
|
91
|
+
#{$property}: (math.div(16, 1440) * 100vw * $delta);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
@include above-max {
|
|
95
|
+
@each $property in $properties {
|
|
96
|
+
#{$property}: (16px * $delta);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@mixin responsive-columns($columns, $size: 1fr) {
|
|
102
|
+
@content;
|
|
103
|
+
|
|
104
|
+
display: grid;
|
|
105
|
+
grid-template-columns: repeat($columns, $size);
|
|
106
|
+
|
|
107
|
+
// Desktop grid (all screens greater than or equal to 1024px)
|
|
108
|
+
@include spacing-single(grid-column-gap);
|
|
109
|
+
|
|
110
|
+
// Mobile grid (all screens up to and including 1023px)
|
|
111
|
+
@include for-tablet-down {
|
|
112
|
+
grid-template-columns: repeat(4, $size);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@mixin at-4-columns {
|
|
117
|
+
@include for-tablet-down {
|
|
118
|
+
@content;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@mixin above-4-columns {
|
|
123
|
+
@include for-desktop {
|
|
124
|
+
@content;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Several components utilize z-index, the CSS property that helps control layout by providing a third axis to arrange content. We utilize a default z-index scale that’s been designed to properly layer navigation, tooltips and popovers, modals, and more.
|
|
3
|
+
These higher values start at an arbitrary number, high and specific enough to ideally avoid conflicts. We need a standard set of these across our layered components—tooltips, popovers, navbars, dropdowns, modals—so we can be reasonably consistent in the behaviors.
|
|
4
|
+
To handle overlapping borders within components (e.g., buttons and inputs in input groups), we use low single digit z-index values of 1, 2, and 3 for default, hover, and active states. On hover/focus/active, we bring a particular element to the forefront with a higher z-index value to show their border over the sibling elements.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
$zindex-dropdown: 1000;
|
|
8
|
+
$zindex-sticky: 1020;
|
|
9
|
+
$zindex-fixed: 1030;
|
|
10
|
+
$zindex-modal-backdrop: 1040;
|
|
11
|
+
$zindex-offcanvas: 1050;
|
|
12
|
+
$zindex-modal: 1060;
|
|
13
|
+
$zindex-popover: 1070;
|
|
14
|
+
$zindex-tooltip: 1080;
|
|
15
|
+
$zindex-close-button: 1090;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg
|
|
2
|
+
aria-hidden="true"
|
|
3
|
+
focusable="false"
|
|
4
|
+
width="15"
|
|
5
|
+
height="15"
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
><path
|
|
8
|
+
d="M.322.313a1.056 1.056 0 0 1 1.5 0l5.679 5.53L13.18.313a1.056 1.056 0 0 1 1.5 0 .993.993 0 0 1-.001 1.461l-5.88 5.725 5.88 5.727c.397.388.426.956.085 1.369l-.086.092a1.056 1.056 0 0 1-1.5 0l-5.679-5.53-5.679 5.53a1.056 1.056 0 0 1-1.5 0 .993.993 0 0 1 .001-1.461L6.2 7.5.322 1.774C-.076 1.386-.105.818.236.405L.322.313Z"
|
|
9
|
+
fill-rule="evenodd"></path></svg
|
|
10
|
+
>
|
|
11
|
+
|
|
12
|
+
<style>svg {
|
|
13
|
+
fill: var(--nav-primary, #404040);
|
|
14
|
+
}</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let width = 20;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
viewBox="0 0 16 12"
|
|
8
|
+
aria-hidden="true"
|
|
9
|
+
focusable="false"
|
|
10
|
+
style="width: {width}px;"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
d="M14.8571429,9.524 C15.3142857,9.524 15.6188571,9.8285714 15.6188571,10.2857143 C15.6188571,10.7428571 15.3142857,11.0474286 14.8571429,11.0474286 L1.14285714,11.0474286 C0.68571429,11.0474286 0.38114286,10.7428571 0.38114286,10.2857143 C0.38114286,9.8285714 0.68571429,9.524 1.14285714,9.524 L14.8571429,9.524 Z M14.8571429,4.9525714 C15.3142857,4.9525714 15.6188571,5.2571429 15.6188571,5.7142857 C15.6188571,6.1714286 15.3142857,6.476 14.8571429,6.476 L1.14285714,6.476 C0.68571429,6.476 0.38114286,6.1714286 0.38114286,5.7142857 C0.38114286,5.2571429 0.68571429,4.9525714 1.14285714,4.9525714 L14.8571429,4.9525714 Z M14.8571429,0.38114286 C15.3142857,0.38114286 15.6188571,0.68571429 15.6188571,1.14285714 C15.6188571,1.6 15.3142857,1.90457143 14.8571429,1.90457143 L1.14285714,1.90457143 C0.68571429,1.90457143 0.38114286,1.6 0.38114286,1.14285714 C0.38114286,0.68571429 0.68571429,0.38114286 1.14285714,0.38114286 L14.8571429,0.38114286 Z"
|
|
14
|
+
></path>
|
|
15
|
+
</svg>
|
|
16
|
+
|
|
17
|
+
<style>svg {
|
|
18
|
+
fill: var(--nav-primary, #404040);
|
|
19
|
+
}</style>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script>/** Primary colour of the spinner. */
|
|
2
|
+
export let colour = '#666';
|
|
3
|
+
/**
|
|
4
|
+
* Outer width of the spinner
|
|
5
|
+
*/
|
|
6
|
+
export let width = 40;
|
|
7
|
+
/**
|
|
8
|
+
* Width of the spinner ring
|
|
9
|
+
*/
|
|
10
|
+
export let ringWidth = 6;
|
|
11
|
+
/**
|
|
12
|
+
* How fast the spinner spins in seconds
|
|
13
|
+
*/
|
|
14
|
+
export let speed = 0.8;
|
|
15
|
+
/**
|
|
16
|
+
* Vertical padding for the spinner's container
|
|
17
|
+
*/
|
|
18
|
+
export let containerPadding = 10;
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div
|
|
22
|
+
style:width="100%"
|
|
23
|
+
style:height={`${(width + (containerPadding * 2))}px`}
|
|
24
|
+
class="component-container"
|
|
25
|
+
>
|
|
26
|
+
<div
|
|
27
|
+
style="
|
|
28
|
+
--spinner-colour: {colour};
|
|
29
|
+
--spinner-ring-width: {ringWidth}px;
|
|
30
|
+
--spinner-ring-offset: -{ringWidth}px;
|
|
31
|
+
--spinner-speed: {speed}s;
|
|
32
|
+
width: {width}px;
|
|
33
|
+
height: {width}px;
|
|
34
|
+
margin: 0 auto;
|
|
35
|
+
"
|
|
36
|
+
>
|
|
37
|
+
<div class="spinner-container">
|
|
38
|
+
<div class="spinner"></div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<style>@-webkit-keyframes spinner {
|
|
44
|
+
to {
|
|
45
|
+
transform: rotate(360deg);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
@keyframes spinner {
|
|
49
|
+
to {
|
|
50
|
+
transform: rotate(360deg);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
.component-container {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.spinner-container {
|
|
60
|
+
position: relative;
|
|
61
|
+
height: 0;
|
|
62
|
+
padding-bottom: 100%;
|
|
63
|
+
color: var(--spinner-colour, #666);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.spinner {
|
|
67
|
+
position: absolute;
|
|
68
|
+
top: 0;
|
|
69
|
+
left: 0;
|
|
70
|
+
width: 100%;
|
|
71
|
+
height: 100%;
|
|
72
|
+
border-radius: 50%;
|
|
73
|
+
border: var(--spinner-ring-width, 6px) solid transparent;
|
|
74
|
+
border-top-color: currentColor;
|
|
75
|
+
-webkit-animation: spinner var(--spinner-speed, 0.8s) linear infinite;
|
|
76
|
+
animation: spinner var(--spinner-speed, 0.8s) linear infinite;
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
}
|
|
79
|
+
.spinner::before {
|
|
80
|
+
content: "";
|
|
81
|
+
position: absolute;
|
|
82
|
+
display: block;
|
|
83
|
+
left: var(--spinner-ring-offset, -6px);
|
|
84
|
+
top: var(--spinner-ring-offset, -6px);
|
|
85
|
+
width: 100%;
|
|
86
|
+
height: 100%;
|
|
87
|
+
border: var(--spinner-ring-width, 6px) solid currentColor;
|
|
88
|
+
box-sizing: content-box;
|
|
89
|
+
border-radius: 50%;
|
|
90
|
+
opacity: 0.25;
|
|
91
|
+
}</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script context="module">import light from './themes/light.js';
|
|
2
|
+
import dark from './themes/dark.js';
|
|
3
|
+
/**
|
|
4
|
+
* Pre-made themes you can import.
|
|
5
|
+
* @type {{ light, dark }}
|
|
6
|
+
*/
|
|
7
|
+
export const themes = { light, dark };
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<script>/** Custom theme object. Can be a partial theme with just
|
|
11
|
+
* what you want to change.
|
|
12
|
+
*/
|
|
13
|
+
export let theme = {};
|
|
14
|
+
/**
|
|
15
|
+
* Base theme is one of `light` or `dark` and will be merged
|
|
16
|
+
* with your custom theme to fill in any values you don't
|
|
17
|
+
* explicitly set.
|
|
18
|
+
*/
|
|
19
|
+
export let base = 'light';
|
|
20
|
+
import cssVariables from '../../actions/cssVariables';
|
|
21
|
+
import flatten from './utils/flatten';
|
|
22
|
+
import mergeThemes from './utils/merge';
|
|
23
|
+
/** @type {Theme} */
|
|
24
|
+
$: mergedTheme = mergeThemes({}, themes[base] || themes.light, theme);
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<div
|
|
28
|
+
class="theme"
|
|
29
|
+
style="display: contents;"
|
|
30
|
+
use:cssVariables="{flatten({ theme: mergedTheme })}"
|
|
31
|
+
>
|
|
32
|
+
<!-- Clients can override the theme above by attaching custom properties to this element. -->
|
|
33
|
+
<div class="theme-client-override" style="display: contents;">
|
|
34
|
+
<!-- Themed content -->
|
|
35
|
+
<slot />
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|