Skip to content

Commit 8143ab3

Browse files
authored
Merge pull request #188 from MITLibraries/uxws-1858
Redesigned "Spotlight" posts to use similar styling to new design system Alerts / SuggestionPanels
2 parents 796fd9c + bf679e2 commit 8143ab3

5 files changed

Lines changed: 38 additions & 47 deletions

File tree

web/app/themes/mitlib-child/inc/content-front.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,16 @@
3636
$the_query->the_post();
3737
?>
3838

39-
<div class="excerpt-post">
39+
<aside aria-label="Featured content" class="mitlib-spotlight">
4040
<?php if ( get_first_post_image() ) : ?>
41-
<img class="excerpt-post__fig" src="<?php echo esc_attr( get_first_post_image() ); ?>" width="200" >
41+
<img src="<?php echo esc_attr( get_first_post_image() ); ?>">
4242
<?php endif; ?>
43-
<div class="excerpt-post__body">
44-
<h3><a href="<?php echo esc_url( the_permalink() ); ?>"><?php the_title(); ?></a></h3>
43+
<div>
44+
<h3><?php the_title(); ?></h3>
4545
<?php custom_excerpt( 20, '...' ); ?>
46-
</div>
47-
</div>
46+
<a class="btn btn-secondary" title="Read more about <?php the_title(); ?>" href="<?php echo esc_url( the_permalink() ); ?>">Read more</a>
47+
</div>
48+
</aside>
4849

4950
<?php
5051
endwhile;

web/app/themes/mitlib-child/style.css

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,6 @@ body.childTheme.page-home {
719719

720720
/* ---- Sticky/Post Excerpts + Flexbox Layout---- */
721721
.wrap-section-hilite,
722-
.excerpt-post,
723722
.category-post {
724723
display: flex;
725724
align-items: flex-start;
@@ -735,42 +734,19 @@ body.childTheme.page-home {
735734
background: #e4e4e4;
736735
}
737736

738-
.excerpt-post {
739-
background: #e4e4e4;
740-
border: 1px solid #b3b3b3;
741-
-webkit-box-shadow: 2px 2px 3px 1px rgba(0,0,0,0.25);
742-
-moz-box-shadow: 2px 2px 3px 1px rgba(0,0,0,0.25);
743-
box-shadow: 2px 2px 3px 1px rgba(0,0,0,0.25);
744-
padding: 25px;
745-
margin-bottom: 35px;
746-
}
747-
748-
.section-hilite-image,
749-
.excerpt-post__fig {
737+
.section-hilite-image {
750738
margin-right: 25px;
751739
position: relative;
752740
top: 5px;
753741
}
754742

755743
.section-hilite,
756-
.excerpt-post__body,
757744
.category-post-content {
758745
flex:1;
759746
font-size: 14px;
760747
line-height: 1.5 ;
761748
}
762749

763-
.excerpt-post .section-hilite h3,
764-
.excerpt-post .excerpt-post__body h3 {
765-
margin-top: 0;
766-
}
767-
768-
.excerpt-post .excerpt-post__body h3 a {
769-
color: #111;
770-
font-weight: 600;
771-
font-size: 16px;
772-
}
773-
774750
/* ---- Sidebar ---- */
775751
.sidebar {
776752
float: left;
@@ -1372,18 +1348,10 @@ a.px14 {
13721348
}
13731349

13741350
/* ---- Sticky/Post Excerpts + Flexbox Layout---- */
1375-
.excerpt-post,
13761351
.category-post {
13771352
flex-direction: column;
13781353
}
13791354

1380-
.excerpt-post__fig {
1381-
margin: 0 auto;
1382-
margin-bottom: 25px;
1383-
min-width: 100%;
1384-
max-width: 100%;
1385-
}
1386-
13871355
.staff-widget .textwidget {
13881356
display: flex;
13891357
align-items: flex-start;

web/app/themes/mitlib-parent/css/scss/modules/_colors.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ $color-guides-experts: $magenta-dark;
149149
// Adding new color values until we can adjust the global variables above
150150
$info-blue: #007499;
151151
$success-green: #009900;
152+
$spotlight-purple: #990099;
152153

153154
$info-border-color: $info-blue;
154155
$info-icon-color: $info-blue;
@@ -160,4 +161,6 @@ $danger-border-color: $red;
160161
$danger-icon-color: $red;
161162

162163
$success-border-color: $success-green;
163-
$success-icon-color: $success-green;
164+
$success-icon-color: $success-green;
165+
166+
$spotlight-border-color: $spotlight-purple;

web/app/themes/mitlib-parent/css/scss/partials/_alerts.scss

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@
9898
}
9999
}
100100

101-
.mitlib-alert {
101+
.mitlib-alert, .mitlib-spotlight {
102102
border: 4px solid $info-border-color;
103103
margin-bottom: 20px;
104104
padding: 16px;
105105
display: flex;
106106

107-
i {
107+
> i {
108108
margin-right: 12px;
109109

110110
&:before{
@@ -124,14 +124,13 @@
124124
}
125125

126126
div > h3 {
127-
font-weight: 700;
127+
font-weight: 600;
128128
margin-top: 2px;
129+
font-size: 1.25rem;
129130
}
130131

131132
p {
132-
margin-bottom: 16px;
133-
134-
&:last-of-type {margin-bottom: 0 !important;}
133+
margin-bottom: 16px;
135134
}
136135

137136
.btn {
@@ -174,4 +173,24 @@
174173
content: "\f00c";
175174
}
176175
}
176+
}
177+
178+
.mitlib-alert {
179+
p:last-of-type {margin-bottom: 0 !important;}
180+
}
181+
182+
.mitlib-spotlight {
183+
border-color: $spotlight-border-color;
184+
column-gap: 24px;
185+
186+
img {
187+
width: 100%;
188+
max-width: 170px;
189+
min-width: 100px;
190+
height: 100%;
191+
}
192+
193+
p {
194+
padding-bottom: 4px;
195+
}
177196
}

web/app/themes/mitlib-parent/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
Theme Name: MITlib Parent
33
Author: MIT Libraries
4-
Version: 0.7
4+
Version: 0.8
55
Description: The parent theme for the MIT Libraries' Pentagram-designed identity.
66
77
*/

0 commit comments

Comments
 (0)