Skip to content

Commit 24c3f1f

Browse files
Merge pull request #28 from MITLibraries/post-84-modern
Improved rendering of blocks on Page records
2 parents 7d71f6b + 2db4d0e commit 24c3f1f

12 files changed

Lines changed: 227 additions & 2 deletions

File tree

asset/css/base.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asset/scss/base.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@
99
// We remove Open Sans from the font stack to prevent sending traffic to Google Fonts.
1010
body {
1111
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
12+
font-size: 1.7rem;
13+
line-height: 1.5;
1214
}

asset/scss/content/_all.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
@import "navigation";
33
@import "search";
44
@import "site-page-pagination";
5+
@import "block-layout/all";
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@import "item-showcase";
2+
@import "item-with-metadata";
3+
@import "list-of-sites";
4+
@import "map";
5+
@import "media-embed";
6+
@import "resource";
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.item-showcase {
2+
border: none;
3+
padding: 1rem;
4+
5+
// Omeka has a bizarre overly-specific rule specifying the maximum height of images in a showcase that ends up overriding the size selection feature. This unsets it.
6+
.resource.item:not(:only-child) img {
7+
max-height: inherit;
8+
}
9+
10+
&.large {
11+
.item.resource {
12+
width: 31%;
13+
margin-left: 1%;
14+
margin-right: 1%;
15+
padding: 0;
16+
}
17+
}
18+
19+
&.medium {
20+
.item.resource {
21+
width: 20rem;
22+
padding: 0;
23+
}
24+
}
25+
26+
&.square {
27+
.item.resource {
28+
width: 20rem;
29+
padding: 0;
30+
}
31+
}
32+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
.item-with-metadata {
2+
float: right;
3+
margin-top: 0;
4+
padding: 1rem;
5+
width: 48%;
6+
7+
.show.resource {
8+
container-type: inline-size;
9+
margin: 0;
10+
padding: 1rem;
11+
text-align: left;
12+
13+
dl {
14+
.property {
15+
display: grid;
16+
grid-template-columns: 1fr 2fr;
17+
gap: 1rem;
18+
margin-bottom: 1rem;
19+
20+
dt {
21+
grid-column: 1;
22+
}
23+
24+
dd {
25+
grid-column: 2;
26+
}
27+
}
28+
}
29+
30+
}
31+
}
32+
33+
@container (width < 500px) {
34+
.show.resource {
35+
background: #fcc;
36+
}
37+
}
38+
39+
@media (width <= 600px) {
40+
.item-with-metadata {
41+
float: none;
42+
width: 100%;
43+
}
44+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.list-of-sites {
2+
.site-list {
3+
.site {
4+
display: flow-root;
5+
margin-bottom: 2rem;
6+
7+
.site-link {
8+
font-size: 2.6rem;
9+
text-decoration: none;
10+
11+
&:hover,
12+
&:focus {
13+
text-decoration: underline;
14+
}
15+
}
16+
}
17+
}
18+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.mapping-block {
2+
margin-bottom: 1rem;
3+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
body.page {
2+
.blocks>.file {
3+
border: none;
4+
padding: 1rem;
5+
6+
.item.resource {
7+
img {
8+
margin: unset;
9+
}
10+
11+
&:first-of-type {
12+
padding: inherit;
13+
margin: inherit;
14+
}
15+
}
16+
17+
&.medium {
18+
.item.resource {
19+
max-width: 20rem;
20+
}
21+
}
22+
23+
&.square {
24+
.item.resource {
25+
max-width: 20rem;
26+
}
27+
}
28+
29+
&.large {
30+
max-width: 48%;
31+
}
32+
33+
&.large.center {
34+
margin: 0 auto;
35+
}
36+
37+
&.right {
38+
padding-right: 0;
39+
}
40+
41+
&.left {
42+
padding-left: 0;
43+
}
44+
}
45+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
body .resource {
2+
margin: 1rem;
3+
padding: 0;
4+
text-align: center;
5+
6+
a {
7+
display: block;
8+
margin-bottom: 1rem;
9+
}
10+
11+
h3 {
12+
padding-bottom: 1rem;
13+
}
14+
15+
img {
16+
border: 1px solid $gray-l3;
17+
box-shadow: 0 0 5px $gray-l3;
18+
margin: 0;
19+
padding: 1rem;
20+
}
21+
22+
.caption {
23+
padding: 0 1rem 1rem;
24+
text-align: left;
25+
}
26+
27+
h3 + .caption {
28+
border-top: 1px solid $gray-l3;
29+
padding-top: 1rem;
30+
}
31+
32+
.file {
33+
border: none;
34+
margin: 0;
35+
}
36+
37+
// There is a very-specific rule coming from Omeka core that we need to override.
38+
&.item {
39+
.caption {
40+
font-size: 1.5rem;
41+
line-height: 1.3;
42+
}
43+
}
44+
}

0 commit comments

Comments
 (0)