pages_core 3.12.1 → 3.12.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/assets/builds/pages_core/admin-dist.js +135 -50
- data/app/assets/builds/pages_core/admin-dist.js.map +7 -0
- data/app/assets/builds/pages_core/admin.css +72 -20
- data/app/assets/stylesheets/pages_core/admin/components/attachments.css +1 -1
- data/app/assets/stylesheets/pages_core/admin/components/image_editor.css +2 -2
- data/app/assets/stylesheets/pages_core/admin/components/image_grid.css +8 -8
- data/app/assets/stylesheets/pages_core/admin/components/image_uploader.css +2 -2
- data/app/assets/stylesheets/pages_core/admin/components/layout.css +2 -2
- data/app/assets/stylesheets/pages_core/admin/components/modal.css +2 -2
- data/app/assets/stylesheets/pages_core/admin/components/search.css +27 -0
- data/app/assets/stylesheets/pages_core/admin/controllers/pages.css +6 -0
- data/app/controllers/admin/pages_controller.rb +12 -11
- data/app/controllers/concerns/pages_core/rss_controller.rb +17 -1
- data/app/controllers/pages_core/admin_controller.rb +6 -0
- data/app/controllers/pages_core/frontend/pages_controller.rb +9 -5
- data/app/controllers/pages_core/sitemaps_controller.rb +3 -5
- data/app/helpers/admin/pages_helper.rb +32 -0
- data/app/helpers/pages_core/images_helper.rb +28 -7
- data/app/javascript/admin-dist.ts +2 -0
- data/app/javascript/components/Attachments/{Attachment.jsx → Attachment.tsx} +42 -33
- data/app/javascript/components/Attachments/{AttachmentEditor.jsx → AttachmentEditor.tsx} +23 -23
- data/app/javascript/components/{EditableImage.jsx → EditableImage.tsx} +27 -24
- data/app/javascript/components/{FileUploadButton.jsx → FileUploadButton.tsx} +15 -16
- data/app/javascript/components/ImageCropper/FocalPoint.tsx +94 -0
- data/app/javascript/components/ImageCropper/{Image.jsx → Image.tsx} +13 -14
- data/app/javascript/components/ImageCropper/{Toolbar.jsx → Toolbar.tsx} +16 -12
- data/app/javascript/components/ImageCropper/{useCrop.js → useCrop.ts} +80 -37
- data/app/javascript/components/{ImageCropper.jsx → ImageCropper.tsx} +17 -15
- data/app/javascript/components/ImageEditor/{Form.jsx → Form.tsx} +24 -23
- data/app/javascript/components/{ImageEditor.jsx → ImageEditor.tsx} +17 -15
- data/app/javascript/components/ImageGrid/{DragElement.jsx → DragElement.tsx} +12 -10
- data/app/javascript/components/ImageGrid/{GridImage.jsx → GridImage.tsx} +40 -30
- data/app/javascript/components/ImageGrid/{Placeholder.jsx → Placeholder.tsx} +5 -6
- data/app/javascript/components/ImageGrid.jsx +3 -4
- data/app/javascript/components/{ImageUploader.jsx → ImageUploader.tsx} +46 -41
- data/app/javascript/components/Modal.tsx +48 -0
- data/app/javascript/components/PageImages.tsx +28 -0
- data/app/javascript/components/{PageTreeDraggable.jsx → PageTree/Draggable.tsx} +79 -57
- data/app/javascript/components/{PageTreeNode.jsx → PageTree/Node.tsx} +79 -70
- data/app/javascript/components/PageTree/types.ts +15 -0
- data/app/javascript/components/PageTree.tsx +206 -0
- data/app/javascript/components/RichTextToolbarButton.tsx +17 -0
- data/app/javascript/components/TagEditor/{AddTagForm.jsx → AddTagForm.tsx} +9 -10
- data/app/javascript/components/TagEditor/{Tag.jsx → Tag.tsx} +8 -9
- data/app/javascript/components/{TagEditor.jsx → TagEditor.tsx} +12 -13
- data/app/javascript/components/Toast.tsx +61 -0
- data/app/javascript/components/drag/{draggedOrder.js → draggedOrder.ts} +22 -12
- data/app/javascript/components/drag/types.ts +28 -0
- data/app/javascript/components/drag/{useDragCollection.js → useDragCollection.ts} +40 -22
- data/app/javascript/components/drag/{useDragUploader.js → useDragUploader.ts} +34 -25
- data/app/javascript/components/drag/useDraggable.ts +21 -0
- data/app/javascript/components/{drag.js → drag.ts} +1 -0
- data/app/javascript/controllers/{EditPageController.js → EditPageController.ts} +3 -1
- data/app/javascript/controllers/{LoginController.js → LoginController.ts} +7 -3
- data/app/javascript/controllers/{MainController.js → MainController.ts} +19 -14
- data/app/javascript/features/{RichText.jsx → RichText.tsx} +3 -3
- data/app/javascript/{index.js → index.ts} +8 -7
- data/app/javascript/lib/{Tree.js → Tree.ts} +106 -85
- data/app/javascript/lib/{copyToClipboard.js → copyToClipboard.ts} +1 -1
- data/app/javascript/lib/{readyHandler.js → readyHandler.ts} +4 -2
- data/app/javascript/lib/{request.js → request.ts} +11 -5
- data/app/javascript/stores/useModalStore.ts +15 -0
- data/app/javascript/stores/useToastStore.ts +26 -0
- data/app/javascript/stores.ts +2 -0
- data/app/javascript/types.ts +30 -0
- data/app/policies/page_policy.rb +4 -0
- data/app/views/admin/calendars/_sidebar.html.erb +3 -0
- data/app/views/admin/news/_sidebar.html.erb +3 -0
- data/app/views/admin/pages/_list_item.html.erb +4 -22
- data/app/views/admin/pages/_search_bar.html.erb +12 -0
- data/app/views/admin/pages/index.html.erb +3 -0
- data/app/views/admin/pages/search.html.erb +54 -0
- data/app/views/feeds/pages.rss.builder +3 -9
- data/config/routes.rb +1 -0
- data/lib/pages_core/configuration/pages.rb +0 -1
- data/lib/rails/generators/pages_core/frontend/frontend_generator.rb +33 -17
- data/lib/rails/generators/pages_core/frontend/templates/application.html.erb +0 -1
- data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/gridOverlay.ts +40 -0
- data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/responsiveEmbeds.ts +68 -0
- data/lib/rails/generators/pages_core/frontend/templates/postcss.config.js +17 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/application.postcss.css +4 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/components/base.css +24 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/components/layout.css +21 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/config.css +5 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/animation.css +5 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/colors.css +18 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/fonts.css +6 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/grid.css +65 -0
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/typography.css +131 -0
- data/lib/rails/generators/pages_core/install/templates/pages_initializer.rb +0 -3
- metadata +69 -63
- data/app/javascript/admin-dist.js +0 -2
- data/app/javascript/components/ImageCropper/FocalPoint.jsx +0 -93
- data/app/javascript/components/Modal.jsx +0 -59
- data/app/javascript/components/PageImages.jsx +0 -25
- data/app/javascript/components/PageTree.jsx +0 -196
- data/app/javascript/components/RichTextToolbarButton.jsx +0 -20
- data/app/javascript/components/Toast.jsx +0 -72
- data/app/javascript/components/drag/useDraggable.js +0 -17
- data/app/javascript/stores/ModalStore.jsx +0 -12
- data/app/javascript/stores/ToastStore.jsx +0 -14
- data/app/javascript/stores.js +0 -2
- data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/GridOverlay.js +0 -66
- data/lib/rails/generators/pages_core/frontend/templates/javascript/lib/ResponsiveEmbeds.js +0 -72
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/application.sass.scss +0 -15
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/components/base.scss +0 -12
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/config.scss +0 -26
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/framework/breakpoints.scss +0 -42
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/framework/clearfix.scss +0 -7
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/framework/fonts.scss +0 -32
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/framework/grid.scss +0 -168
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/framework/grid_overlay.scss +0 -44
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/colors.scss +0 -8
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/global/typography.scss +0 -90
- data/lib/rails/generators/pages_core/frontend/templates/stylesheets/vendor/normalize.css +0 -349
- /data/app/javascript/components/Attachments/{Placeholder.jsx → Placeholder.tsx} +0 -0
- /data/app/javascript/components/ImageGrid/{FilePlaceholder.jsx → FilePlaceholder.tsx} +0 -0
- /data/app/javascript/{components.js → components.ts} +0 -0
- /data/app/javascript/{hooks.js → hooks.ts} +0 -0
@@ -14,40 +14,56 @@ module PagesCore
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def create_css_framework
|
17
|
-
["application.
|
18
|
-
"config.
|
19
|
-
"components/base.
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
23
|
-
"
|
24
|
-
"
|
25
|
-
"global/
|
26
|
-
"global/typography.scss",
|
27
|
-
"vendor/normalize.css"].each do |f|
|
17
|
+
["application.postcss.css",
|
18
|
+
"config.css",
|
19
|
+
"components/base.css",
|
20
|
+
"components/layout.css",
|
21
|
+
"global/animation.css",
|
22
|
+
"global/colors.css",
|
23
|
+
"global/fonts.css",
|
24
|
+
"global/grid.css",
|
25
|
+
"global/typography.css"].each do |f|
|
28
26
|
template("stylesheets/#{f}", File.join("app/assets/stylesheets/#{f}"))
|
29
27
|
end
|
30
28
|
end
|
31
29
|
|
32
30
|
def create_js_framework
|
33
|
-
["lib/
|
34
|
-
"lib/
|
31
|
+
["lib/responsiveEmbeds.ts",
|
32
|
+
"lib/gridOverlay.ts"].each do |f|
|
35
33
|
template("javascript/#{f}", File.join("app/javascript/#{f}"))
|
36
34
|
end
|
37
35
|
|
38
36
|
append_to_file "app/javascript/application.js" do
|
39
37
|
<<~JS
|
40
38
|
// Responsive embeds
|
41
|
-
import
|
42
|
-
|
39
|
+
import responsiveEmbeds from "./lib/responsiveEmbeds";
|
40
|
+
responsiveEmbeds();
|
43
41
|
|
44
42
|
// Grid overlay
|
45
|
-
import
|
46
|
-
|
43
|
+
import gridOverlay from "./lib/gridOverlay";
|
44
|
+
gridOverlay();
|
47
45
|
JS
|
48
46
|
end
|
49
47
|
end
|
50
48
|
|
49
|
+
def install_js_dependencies
|
50
|
+
run("yarn add autoprefixer cssnano normalize.css postcss " \
|
51
|
+
"postcss-calc postcss-cli postcss-import " \
|
52
|
+
"postcss-import-ext-glob postcss-mixins postcss-preset-env " \
|
53
|
+
"postcss-url")
|
54
|
+
end
|
55
|
+
|
56
|
+
def configure_postcss
|
57
|
+
copy_file("postcss.config.js",
|
58
|
+
File.join("postcss.config.js"))
|
59
|
+
end
|
60
|
+
|
61
|
+
def configure_build_script
|
62
|
+
script = "postcss ./app/assets/stylesheets/application.postcss.css " \
|
63
|
+
"-o ./app/assets/builds/application.css"
|
64
|
+
run %(npm set-script build:css "#{script}")
|
65
|
+
end
|
66
|
+
|
51
67
|
def remove_application_css
|
52
68
|
remove_file("app/assets/stylesheets/application.css")
|
53
69
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
function ready(callback: () => void) {
|
2
|
+
if (document.readyState === "complete" ||
|
3
|
+
(document.readyState !== "loading" && !document.documentElement.doScroll)) {
|
4
|
+
callback();
|
5
|
+
} else {
|
6
|
+
document.addEventListener("DOMContentLoaded", callback);
|
7
|
+
}
|
8
|
+
}
|
9
|
+
|
10
|
+
function applyGrid () {
|
11
|
+
let showGrid = false;
|
12
|
+
const gridOverlay = document.querySelector(".grid-overlay");
|
13
|
+
|
14
|
+
const setState = (newState: boolean) => {
|
15
|
+
showGrid = newState;
|
16
|
+
|
17
|
+
if (newState) {
|
18
|
+
window.localStorage.setItem("showGrid", "true");
|
19
|
+
gridOverlay.classList.add("grid-overlay--active");
|
20
|
+
} else {
|
21
|
+
window.localStorage.removeItem("showGrid");
|
22
|
+
gridOverlay.classList.remove("grid-overlay--active");
|
23
|
+
}
|
24
|
+
};
|
25
|
+
|
26
|
+
if (gridOverlay) {
|
27
|
+
setState(window.localStorage.getItem("showGrid") == "true");
|
28
|
+
|
29
|
+
// Keyboard toggle
|
30
|
+
document.addEventListener("keyup", (evt: KeyboardEvent) => {
|
31
|
+
if (evt.ctrlKey && evt.which == 71) {
|
32
|
+
setState(!showGrid);
|
33
|
+
}
|
34
|
+
});
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
export default function gridOverlay() {
|
39
|
+
ready(applyGrid);
|
40
|
+
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
const selectors = [
|
2
|
+
"iframe[src*=\"bandcamp.com\"]",
|
3
|
+
"iframe[src*=\"player.vimeo.com\"]",
|
4
|
+
"iframe[src*=\"youtube.com\"]",
|
5
|
+
"iframe[src*=\"youtube-nocookie.com\"]",
|
6
|
+
"iframe[src*=\"spotify.com\"]",
|
7
|
+
"iframe[src*=\"kickstarter.com\"][src*=\"video.html\"]"
|
8
|
+
];
|
9
|
+
|
10
|
+
function readyHandler(fn: () => void) {
|
11
|
+
if (document.readyState === "complete" || document.readyState === "interactive") {
|
12
|
+
setTimeout(fn, 1);
|
13
|
+
} else {
|
14
|
+
document.addEventListener("DOMContentLoaded", fn);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
function wrapEmbed(embed: HTMLElement): HTMLElement {
|
19
|
+
const parent = embed.parentNode as HTMLElement;
|
20
|
+
|
21
|
+
// Recycle the existing container if the embed is already responsive.
|
22
|
+
if (parent &&
|
23
|
+
parent.tagName === "DIV" &&
|
24
|
+
parent.childNodes.length === 1 &&
|
25
|
+
parent.style.position === "relative") {
|
26
|
+
return parent;
|
27
|
+
}
|
28
|
+
|
29
|
+
const wrapper = document.createElement("div");
|
30
|
+
if (parent.tagName === "P") {
|
31
|
+
parent.parentNode.replaceChild(wrapper, parent);
|
32
|
+
} else {
|
33
|
+
parent.replaceChild(wrapper, embed);
|
34
|
+
}
|
35
|
+
wrapper.appendChild(embed);
|
36
|
+
return wrapper;
|
37
|
+
}
|
38
|
+
|
39
|
+
function applyEmbed(embed: HTMLElement) {
|
40
|
+
const parent = embed.parentNode as HTMLElement;
|
41
|
+
|
42
|
+
if (parent && parent.classList.contains("responsive-embed")) {
|
43
|
+
return;
|
44
|
+
}
|
45
|
+
|
46
|
+
const width = embed.offsetWidth;
|
47
|
+
const height = embed.offsetHeight;
|
48
|
+
const ratio = height / width;
|
49
|
+
const wrapper = wrapEmbed(embed);
|
50
|
+
|
51
|
+
wrapper.classList.add("responsive-embed");
|
52
|
+
wrapper.style.position = "relative";
|
53
|
+
wrapper.style.width = "100%";
|
54
|
+
wrapper.style.paddingTop = 0;
|
55
|
+
wrapper.style.paddingBottom = `${ratio * 100}%`;
|
56
|
+
|
57
|
+
embed.style.position = "absolute";
|
58
|
+
embed.style.width = "100%";
|
59
|
+
embed.style.height = "100%";
|
60
|
+
embed.style.top = "0";
|
61
|
+
embed.style.left = "0";
|
62
|
+
}
|
63
|
+
|
64
|
+
export default function responsiveEmbeds() {
|
65
|
+
readyHandler(() => {
|
66
|
+
document.querySelectorAll(selectors.join(",")).forEach(applyEmbed);
|
67
|
+
});
|
68
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module.exports = {
|
2
|
+
plugins: [
|
3
|
+
require("postcss-import-ext-glob"),
|
4
|
+
require("postcss-import"),
|
5
|
+
require("postcss-url")(
|
6
|
+
{ filter: "**/*.svg",
|
7
|
+
url: "inline",
|
8
|
+
basePath: "../images" }
|
9
|
+
),
|
10
|
+
require("postcss-mixins"),
|
11
|
+
require("postcss-simple-vars"),
|
12
|
+
require("postcss-preset-env")({ stage: 1 }),
|
13
|
+
require("postcss-calc")({ precision: 10 }),
|
14
|
+
require("autoprefixer"),
|
15
|
+
require("postcss-discard-duplicates")
|
16
|
+
],
|
17
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
*, *:before, *:after {
|
2
|
+
box-sizing: border-box;
|
3
|
+
}
|
4
|
+
|
5
|
+
.responsive-embed,
|
6
|
+
figure.image {
|
7
|
+
margin: 2rem 0rem;
|
8
|
+
@mixin child-margins;
|
9
|
+
}
|
10
|
+
|
11
|
+
figure.image {
|
12
|
+
width: 100%;
|
13
|
+
padding: 0rem;
|
14
|
+
|
15
|
+
& img {
|
16
|
+
display: block;
|
17
|
+
width: 100%;
|
18
|
+
height: auto;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
img {
|
23
|
+
display: block;
|
24
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
body {
|
2
|
+
min-height: 100vh;
|
3
|
+
display: flex;
|
4
|
+
flex-direction: column;
|
5
|
+
}
|
6
|
+
|
7
|
+
footer {
|
8
|
+
margin-top: auto;
|
9
|
+
}
|
10
|
+
|
11
|
+
header,
|
12
|
+
main,
|
13
|
+
footer {
|
14
|
+
padding-left: var(--outer-padding);
|
15
|
+
padding-right: var(--outer-padding);
|
16
|
+
& .inner {
|
17
|
+
@mixin grid-container;
|
18
|
+
max-width: var(--grid-limit, 100%);
|
19
|
+
margin: 0px auto;
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
:root {
|
2
|
+
--black: #000000;
|
3
|
+
--white: #ffffff;
|
4
|
+
--blue: #0000ff;
|
5
|
+
|
6
|
+
--background-color: var(--white);
|
7
|
+
--text-color: var(--black);
|
8
|
+
--link-color: var(--blue);
|
9
|
+
}
|
10
|
+
|
11
|
+
body {
|
12
|
+
background: var(--background-color);
|
13
|
+
color: var(--text-color);
|
14
|
+
}
|
15
|
+
|
16
|
+
a, a:visited {
|
17
|
+
color: var(--link-color);
|
18
|
+
}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
@define-mixin grid-container {
|
2
|
+
display: grid;
|
3
|
+
grid-template-columns: repeat(var(--columns), 1fr);
|
4
|
+
grid-column-gap: var(--gutter);
|
5
|
+
}
|
6
|
+
|
7
|
+
@define-mixin grid-limit $limit {
|
8
|
+
@media screen and (min-width: $limit) {
|
9
|
+
--grid-limit: calc($limit - (var(--outer-padding) * 2));
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
:root {
|
14
|
+
--columns: 12;
|
15
|
+
--gutter: 2rem;
|
16
|
+
--outer-padding: 2rem;
|
17
|
+
|
18
|
+
@media (--tablet) {
|
19
|
+
//--columns: 9;
|
20
|
+
--gutter: 1.5rem;
|
21
|
+
--outer-padding: 1.5rem;
|
22
|
+
}
|
23
|
+
|
24
|
+
@media (--mobile) {
|
25
|
+
--columns: 4;
|
26
|
+
--outer-padding: 1rem;
|
27
|
+
}
|
28
|
+
|
29
|
+
@media print {
|
30
|
+
--outer-padding: 0px;
|
31
|
+
}
|
32
|
+
|
33
|
+
--column-width: calc(
|
34
|
+
(100% -
|
35
|
+
((var(--gutter) * (var(--columns) - 1)) + (var(--outer-padding) * 2))) /
|
36
|
+
var(--columns)
|
37
|
+
);
|
38
|
+
|
39
|
+
/* @mixin grid-limit 1400px; */
|
40
|
+
}
|
41
|
+
|
42
|
+
.grid-overlay {
|
43
|
+
display: none;
|
44
|
+
}
|
45
|
+
|
46
|
+
.grid-overlay--active {
|
47
|
+
--grid-overlay-width: var(--grid-limit,
|
48
|
+
calc(100% - (var(--outer-padding) * 2)));
|
49
|
+
display: block;
|
50
|
+
position: fixed;
|
51
|
+
z-index: 9000;
|
52
|
+
top: 0px;
|
53
|
+
width: var(--grid-overlay-width);
|
54
|
+
left: 50%;
|
55
|
+
margin-left: calc(var(--grid-overlay-width) / 2 * -1);
|
56
|
+
height: 100%;
|
57
|
+
pointer-events: none;
|
58
|
+
background: linear-gradient(
|
59
|
+
to right,
|
60
|
+
var(--grid-overlay-gutter, transparent) var(--gutter),
|
61
|
+
var(--grid-overlay-column, rgba(255, 0, 255, 0.05)) var(--gutter)
|
62
|
+
);
|
63
|
+
background-size: calc((100% + var(--gutter)) / var(--columns, 12)) 100%;
|
64
|
+
background-position: top 0px left calc(var(--gutter) * -1);
|
65
|
+
}
|
@@ -0,0 +1,131 @@
|
|
1
|
+
/* ---- Mixins ------------------------------------------------------------- */
|
2
|
+
|
3
|
+
@define-mixin child-margins {
|
4
|
+
&:first-child {
|
5
|
+
margin-top: 0px;
|
6
|
+
}
|
7
|
+
&:last-child {
|
8
|
+
margin-bottom: 0px;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
@define-mixin font-scale-base {
|
13
|
+
--font-scale-coeff: calc((var(--font-scale-to) - var(--font-scale-from)) /
|
14
|
+
((var(--font-scale-end) / 100) -
|
15
|
+
(var(--font-scale-start) / 100)));
|
16
|
+
|
17
|
+
font-size: calc(calc((var(--font-scale-from) -
|
18
|
+
(var(--font-scale-start) / 100) *
|
19
|
+
var(--font-scale-coeff)) /
|
20
|
+
16) * 1rem +
|
21
|
+
var(--font-scale-coeff) * 1vw);
|
22
|
+
}
|
23
|
+
|
24
|
+
@define-mixin font-scale $from, $to, $start, $end {
|
25
|
+
--font-scale-from: $from;
|
26
|
+
--font-scale-to: $to;
|
27
|
+
--font-scale-start: $start;
|
28
|
+
--font-scale-end: $end;
|
29
|
+
}
|
30
|
+
|
31
|
+
|
32
|
+
/* ---- Definitions -------------------------------------------------------- */
|
33
|
+
|
34
|
+
:root {
|
35
|
+
--font-sans: Helvetica, sans-serif;
|
36
|
+
|
37
|
+
--font-larger: 500 2.0rem/1.1 var(--font-sans);
|
38
|
+
--font-large: 500 1.5rem/1.1 var(--font-sans);
|
39
|
+
--font-medium: 500 1.5rem/1.1 var(--font-sans);
|
40
|
+
--font-normal: normal 1.25rem/1.1 var(--font-sans);
|
41
|
+
--font-small: normal 1.0rem/1.1 var(--font-sans);
|
42
|
+
|
43
|
+
@media (--tablet) {
|
44
|
+
/*
|
45
|
+
--font-larger: 500 1.5rem/1.1 var(--font-sans);
|
46
|
+
--font-large: 500 1.5rem/1.1 var(--font-sans);
|
47
|
+
--font-medium: 500 1.125rem/1.1 var(--font-sans);
|
48
|
+
*/
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
|
53
|
+
/* ---- Font scale --------------------------------------------------------- */
|
54
|
+
|
55
|
+
html {
|
56
|
+
@mixin font-scale-base;
|
57
|
+
@mixin font-scale 16, 18, 1440, 1920;
|
58
|
+
@media screen and (max-width: 1440px) {
|
59
|
+
@mixin font-scale 14, 16, $breakpoint-mobile-small, 1440;
|
60
|
+
}
|
61
|
+
@media (--mobile-small) {
|
62
|
+
@mixin font-scale 12, 16, 1, $breakpoint-mobile-small;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
body {
|
67
|
+
font-family: var(--font-sans);
|
68
|
+
font-size: 100%;
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
/* ---- Rules -------------------------------------------------------------- */
|
73
|
+
|
74
|
+
h1, h2, h3, h4, h5, h6, p, ul, ol {
|
75
|
+
margin: 1rem 0rem;
|
76
|
+
@mixin child-margins;
|
77
|
+
}
|
78
|
+
|
79
|
+
h1, h2, h3, h4, h5, h6, p, ul, ol,
|
80
|
+
figcaption, blockquote {
|
81
|
+
max-width: 60ch;
|
82
|
+
}
|
83
|
+
|
84
|
+
ul, ol, blockquote {
|
85
|
+
margin-top: 2rem;
|
86
|
+
margin-bottom: 2rem;
|
87
|
+
@mixin child-margins;
|
88
|
+
}
|
89
|
+
|
90
|
+
main {
|
91
|
+
font: var(--font-normal);
|
92
|
+
}
|
93
|
+
|
94
|
+
h1 {
|
95
|
+
font: var(--font-larger);
|
96
|
+
}
|
97
|
+
|
98
|
+
h2 {
|
99
|
+
font: var(--font-large);
|
100
|
+
margin-top: 2rem;
|
101
|
+
@mixin child-margins;
|
102
|
+
}
|
103
|
+
|
104
|
+
h3 {
|
105
|
+
font: var(--font-medium);
|
106
|
+
margin-top: 2rem;
|
107
|
+
@mixin child-margins;
|
108
|
+
}
|
109
|
+
|
110
|
+
h4 {
|
111
|
+
font: var(--font-normal);
|
112
|
+
}
|
113
|
+
|
114
|
+
h5 {
|
115
|
+
font: var(--font-smaller);
|
116
|
+
}
|
117
|
+
|
118
|
+
h6 {
|
119
|
+
font: var(--font-smallest);
|
120
|
+
}
|
121
|
+
|
122
|
+
blockquote {
|
123
|
+
font: var(--font-medium);
|
124
|
+
margin: 2rem 0rem;
|
125
|
+
@mixin child-margins;
|
126
|
+
}
|
127
|
+
|
128
|
+
figcaption {
|
129
|
+
margin-top: 0.5rem;
|
130
|
+
font: var(--font-small);
|
131
|
+
}
|
@@ -13,9 +13,6 @@ PagesCore.configure do |config|
|
|
13
13
|
# Locales and names
|
14
14
|
# config.locales(nb: 'Norwegian', en: 'English')
|
15
15
|
|
16
|
-
# Fulltext in RSS feeds (default: disabled)
|
17
|
-
# config.rss_fulltext :disabled
|
18
|
-
|
19
16
|
# New pages will be created by the user with this email address:
|
20
17
|
# config.default_author "email@example.com"
|
21
18
|
|