Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace old custom versions of FontAwesome with new FontAwesome 6 via our own CDN #166

Merged
merged 14 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion web/app/themes/mitlib-child/css/scss/interviewees.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@

&:before {
content: " ";
font-family: FontAwesome;
font-family: 'Font Awesome 6 Free';
color: #338bc5;
font-size: 12px;
font-weight: 600;
margin-left: -12px;
}
}
Expand Down
3 changes: 3 additions & 0 deletions web/app/themes/mitlib-child/css/scss/interviews.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.row-icon {
margin: 9px 9px 6px 9px;
padding-top: 4px;
}

.list-inline {
Expand All @@ -17,6 +18,8 @@
margin-right: 12px;
}

&.links i {margin-right: 4px;}

&.tags li,
&.categories li {
padding-left: 0;
Expand Down
2 changes: 0 additions & 2 deletions web/app/themes/mitlib-child/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ function child_scripts_styles() {

// First we register stylesheet libraries.
wp_register_style( 'bootstrap', '//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css', array(), '3.0.0' );
wp_register_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css', array(), '4.6.0' );
wp_register_style( 'interviews', get_stylesheet_directory_uri() . '/css/build/interviews.css', array(), $theme_version );
wp_register_style( 'interviewees', get_stylesheet_directory_uri() . '/css/build/interviewees.css', array(), $theme_version );
wp_register_style( 'child-style', get_stylesheet_uri(), array( 'parent-global', 'dashicons' ), $theme_version );
Expand All @@ -43,7 +42,6 @@ function child_scripts_styles() {

// Finally we enqueue those libraries - the child theme just always enqueues everything.
wp_enqueue_style( 'bootstrap' );
wp_enqueue_style( 'font-awesome' );
wp_enqueue_style( 'child-style' );
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'bootstrap-js' );
Expand Down
2 changes: 1 addition & 1 deletion web/app/themes/mitlib-child/inc/location.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
<?php if ( $docs_email ) : ?>
<a href="mailto:<?php echo esc_attr( $docs_email ); ?>" class="email"><?php echo esc_html( $docs_email ); ?></a> |
<?php endif; ?>
<a href="<?php echo esc_attr( $map_page ); ?>">Room: <?php echo esc_html( $docs_building ); ?> <i class="icon-arrow-right"></i></a>
<a href="<?php echo esc_attr( $map_page ); ?>">Room: <?php echo esc_html( $docs_building ); ?> <i class="fa-solid fa-arrow-right"></i></a>
</div>
10 changes: 5 additions & 5 deletions web/app/themes/mitlib-child/single-interview.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</div>
<div class="flex-item">
<div class="flex-container">
<i class="icon-folder-close flex-item row-icon"></i>
<i class="fa fa-folder flex-item row-icon"></i></i>
<ul class="list-inline categories flex-item">
<?php
foreach ( $categories as $category ) {
Expand All @@ -110,7 +110,7 @@
</ul>
</div>
<div class="flex-container">
<i class="icon-tag flex-item row-icon"></i>
<i class="fa fa-tag flex-item row-icon"></i>
<ul class="list-inline tags flex-item">
<?php
foreach ( $tags as $tag ) {
Expand All @@ -122,16 +122,16 @@
<ul class="list-inline links">
<?php
if ( $audio ) {
echo '<li><i class="icon-download"></i> <a href="' . esc_url( $audio ) . '">Download (MP3)</a></li>';
echo '<li><i class="fa-regular fa-circle-down"></i> <a href="' . esc_url( $audio ) . '">Download (MP3)</a></li>';
}
if ( $transcript ) {
echo '<li><i class="icon-file"></i> <a href="' . esc_url( $transcript ) . '">Transcript (PDF)</a></li>';
echo '<li><i class="fa-regular fa-file-lines"></i> <a href="' . esc_url( $transcript ) . '">Transcript (PDF)</a></li>';
}
if ( $cd ) {
echo '<li><span class="dashicons dashicons-album"></span> <a href="' . esc_url( $cd ) . '">CD available in the library</a></li>';
}
if ( $print ) {
echo '<li><i class="icon-book"></i> <a href="' . esc_url( $print ) . '">Print transcript available in the library</a></li>';
echo '<li><i class="fa fa-book"></i> <a href="' . esc_url( $print ) . '">Print transcript available in the library</a></li>';
}
?>
</ul>
Expand Down
8 changes: 4 additions & 4 deletions web/app/themes/mitlib-child/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ b, strong {
.childTheme .todayHours a:after,.childTheme .locationInfo a:after {
content:'\f061';
display:inline-block;
font-family:'fontawesome-MITLibraries';
font-family:'Font Awesome 6 Free';
margin-left:.5em;
}

Expand Down Expand Up @@ -997,7 +997,7 @@ a.px14 {

.upw-content .custom-field-event_date:before {
margin-right: 5px;
font-family:FontAwesome;
font-family:'Font Awesome 6 Free';
content:"\f073" !important;
color: #F58733;
font-size: 1em;
Expand Down Expand Up @@ -1145,7 +1145,7 @@ a.px14 {
.exhibits-button:after {
content:'\f061';
display:inline-block;
font-family:'fontawesome';
font-family:'Font Awesome 6 Free';
margin-left:.5em;
}

Expand Down Expand Up @@ -1189,7 +1189,7 @@ a.px14 {

.button.button-music:before {
content: "\f028";
font-family: FontAwesome;
font-family: 'Font Awesome 6 Free';
font-weight: normal;
font-size: inherit;
margin-right: 10px;
Expand Down
2 changes: 0 additions & 2 deletions web/app/themes/mitlib-news/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function news_scripts_styles() {
$parent_version = wp_get_theme()->parent()->get( 'Version' );

// Register stylesheets.
wp_register_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.6.0/css/font-awesome.min.css', array(), '4.6.0' );
wp_register_style( 'parent-style', get_template_directory_uri() . '/style.css', array(), $parent_version );
wp_register_style( 'bootstrap', get_stylesheet_directory_uri() . '/css/bootstrap.css', array(), $theme_version );
wp_register_style( 'newsmobile', get_stylesheet_directory_uri() . '/css/newsmobile.css', array(), $theme_version );
Expand All @@ -37,7 +36,6 @@ function news_scripts_styles() {
wp_register_script( 'myScripts', get_stylesheet_directory_uri() . '/js/myScripts.js', array( 'lazyload' ), $theme_version, false );

// Enqueue libraries - these files are always loaded.
wp_enqueue_style( 'font-awesome' );
wp_enqueue_style( 'parent-style' );
wp_enqueue_style( 'bootstrap' );
wp_enqueue_style( 'newsmobile' );
Expand Down
3 changes: 2 additions & 1 deletion web/app/themes/mitlib-parent/css/scss/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,12 @@ ul.arrows li:before,
.single-location .tab ul.arrows li:before,
.page-template-page-location-php .tab ul.arrows li:before
{
font-family:FontAwesome;
font-family:'Font Awesome 6 Free';
content:"\f061";
color: #338bc5;
font-size: .75em;
margin-right: 7px;
font-weight: 600;
}

.locationContent ul li {
Expand Down
6 changes: 4 additions & 2 deletions web/app/themes/mitlib-parent/css/scss/global.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@import "modules/all";
@import "main";
@import "responsive";
@import "../../libs/fontawesome/css/font-awesome";
@import "../../libs/fontawesome-MITLibraries/style";
@import "https://cdn.libraries.mit.edu/files/fontawesome/6.7.1/css/fontawesome.css";
@import "https://cdn.libraries.mit.edu/files/fontawesome/6.7.1/css/solid.css";
@import "https://cdn.libraries.mit.edu/files/fontawesome/6.7.1/css/regular.css";
@import "https://cdn.libraries.mit.edu/files/fontawesome/6.7.1/css/brands.css";
@import "partials/base";
@import "libs/base";
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
flex-direction: column;
}
&:before {
font-family:FontAwesome;
font-family:'Font Awesome 6 Free';
content:"\f0da";
margin-right: 1em;
color: #338bc5;
Expand Down
21 changes: 12 additions & 9 deletions web/app/themes/mitlib-parent/css/scss/partials/_alerts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
opacity: 0;
}

.posts--preview--alerts .icon-exclamation-sign,
.location--alerts .icon-exclamation-sign {
.posts--preview--alerts .fa-circle-exclamation,
.location--alerts .fa-circle-exclamation {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an active alert somewhere on the multidev? I don't see one on the locations page or the homepage at the moment, which is where I know to look for these at the moment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I was able to trip these rules by adding a new alert to my local - so this isn't a blocking comment.

color: $black;
font-size: 3.5em;
font-size: 2.75em;
margin: 0 .5em 0 .25em;
position: relative;
@include bp-mobile--only {
Expand Down Expand Up @@ -109,14 +109,17 @@

&:before{
color: $info-icon-color;
content: "\f05a";
content: "\f129";

font-family: FontAwesome;
font-weight: normal;
font-size: 24px;
font-family: 'Font Awesome 6 Free';
font-weight: 600;
font-size: 22px;
font-style: normal;
display: inline-block;
padding-top: 1px;
text-align: center;
text-decoration: inherit;
width: 20px;
}
}

Expand Down Expand Up @@ -150,7 +153,7 @@

i:before {
color: $warning-icon-color;
content: "\f06a";
content: "\f071";
}
}

Expand All @@ -168,7 +171,7 @@

i:before {
color: $success-icon-color;
content: "\f046";
content: "\f00c";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
.content ul+h3 {
margin-top: 15px;
}

.libraryAlertTop {
margin-top: 24px;
}
}

.locationPage {
Expand Down
17 changes: 9 additions & 8 deletions web/app/themes/mitlib-parent/css/scss/partials/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
position:absolute;
top: 4px;
left: -15px;
font-family:FontAwesome;
font-family:'Font Awesome 6 Free';
font-weight: 600;
content:"\f138";
color: #338bc5;
font-size: 11px;
Expand All @@ -40,7 +41,7 @@
position:absolute;
top: 1px;
left: -20px;
font-family:FontAwesome;
font-family:'Font Awesome 6 Brands';
content:"\f099" !important;
color: #338bc5;
font-size: 14px;
Expand All @@ -49,7 +50,7 @@
position:absolute;
top: 2px;
left: -20px;
font-family:FontAwesome;
font-family:'Font Awesome 6 Brands';
content:"\f082" !important;
color: #338bc5;
font-size: 14px;
Expand All @@ -58,7 +59,7 @@
position:absolute;
top: 3px;
left: -20px;
font-family:FontAwesome;
font-family:'Font Awesome 6 Free';
content:"\f003" !important;
color: #338bc5;
font-size: 14px;
Expand All @@ -67,7 +68,7 @@
position:absolute;
top: 3px;
left: -20px;
font-family:FontAwesome;
font-family:'Font Awesome 6 Brands';
content:"\f16d" !important;
color: #338bc5;
font-size: 1em;
Expand All @@ -76,7 +77,7 @@
position:absolute;
top: 3px;
left: -20px;
font-family:FontAwesome;
font-family:'Font Awesome 6 Brands';
content:"\f0d5" !important;
color: #338bc5;
font-size: 1em;
Expand All @@ -85,7 +86,7 @@
position:absolute;
top: 3px;
left: -20px;
font-family:FontAwesome;
font-family:'Font Awesome 6 Brands';
content:"\f0d2" !important;
color: #338bc5;
font-size: 1em;
Expand All @@ -94,7 +95,7 @@
position:absolute;
top: 3px;
left: -20px;
font-family:FontAwesome;
font-family:'Font Awesome 6 Brands';
content:"\f16a" !important;
color: #338bc5;
font-size: 1em;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@
position: relative;
}

.hrList .libraryAlert .icon-exclamation-sign {
.hrList .libraryAlert i {
color: #ffcc33;
float: left;
font-size: 2em;
font-size: 1.6em;
position: absolute;
top: 0;
left: 3.5%;
top: 0.4em;
left: 0.425em;
}

.hrList .libraryAlert h3 {
Expand Down
10 changes: 5 additions & 5 deletions web/app/themes/mitlib-parent/inc/content-location-2021.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<?php if ( $email ) : ?>
<a href="mailto:<?php echo esc_url( $email ); ?>" class="email"><?php echo esc_html( $email ); ?></a> |
<?php endif; ?>
<a href="<?php echo esc_url( $mapPage . $slug ); ?>">Room: <?php echo esc_html( $building ); ?> <i class="icon-arrow-right"></i></a>
<a href="<?php echo esc_url( $mapPage . $slug ); ?>">Room: <?php echo esc_html( $building ); ?> <i class="fa fa-arrow-right"></i></a>
</div>
</div><!-- end div.libraryContent -->

Expand All @@ -98,15 +98,15 @@
<?php if ( true === $study24 ) : ?>
<a class="study-24-7" href="<?php echo esc_url( $gStudy24Url ); ?>" alt="This location contains one or more study spaces available 24 hours a day, seven days a week. Click the link for more info." title="Study 24/7">Study 24/7</a>
<?php endif; ?>
<a href="/hours" class="link-hours-all">See all hours <i class="icon-arrow-right"></i></a>
<a href="/hours" class="link-hours-all">See all hours <i class="fa fa-arrow-right"></i></a>
</div>
<?php } else { ?>
<div class="hours-today">
<span>Today's hours: <strong data-location-hours="<?php the_title(); ?>"></strong></span>
<?php if ( true === $study24 ) : ?>
| <a class="study-24-7" href="<?php echo esc_url( $gStudy24Url ); ?>" alt="This location contains one or more study spaces available 24 hours a day, seven days a week. Click the link for more info." title="Study 24/7">Study 24/7</a>
<?php endif; ?>
<a href="/hours" class="link-hours-all">See all hours <i class="icon-arrow-right"></i></a>
<a href="/hours" class="link-hours-all">See all hours <i class="fa fa-arrow-right"></i></a>
</div><!-- end div.hours-today -->
<?php } ?>
</div><!-- end div.topLeft -->
Expand Down Expand Up @@ -170,8 +170,8 @@
<span class="bio"><?php echo esc_html( $bio ); ?></span>
</h3>
<div class="links">
<a class="primary" href="<?php echo esc_url( $url ); ?>" target="_blank">How can I help? <i class="icon-arrow-right"></i></a>
<a href="/experts">See all our experts <i class="icon-arrow-right"></i></a>
<a class="primary" href="<?php echo esc_url( $url ); ?>" target="_blank">How can I help? <i class="fa fa-arrow-right"></i></a>
<a href="/experts">See all our experts <i class="fa fa-arrow-right"></i></a>
</div>

</div>
Expand Down
Loading
Loading