Try to reduce CSS size

pull/3888/head
Chocobozzz 2021-03-11 10:40:59 +01:00
parent ae71acca14
commit 5d43dae369
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
11 changed files with 207 additions and 256 deletions

View File

@ -58,12 +58,11 @@ export class PeerTubeSocket {
this.notificationSocket = this.io(environment.apiUrl + '/user-notifications', {
query: { accessToken: this.auth.getAccessToken() }
})
this.notificationSocket.on('new-notification', (n: UserNotificationServer) => {
this.ngZone.run(() => this.dispatchNotificationEvent('new', n))
})
})
this.notificationSocket.on('new-notification', (n: UserNotificationServer) => {
this.ngZone.run(() => this.dispatchNotificationEvent('new', n))
})
}
private async initLiveVideosSocket () {

View File

@ -3,6 +3,7 @@
$menu-link-icon-size: 22px;
$menu-link-icon-margin-right: 18px;
$footer-links-base-opacity: .8;
@mixin menu-link {
display: flex;
@ -91,168 +92,168 @@ menu {
align-items: center;
justify-content: left;
.logged-in-more {
$main-radius: 25px;
flex: 1;
margin-left: 13px;
border-radius: $main-radius;
transition: all .1s ease-in-out;
cursor: pointer;
*, & {
line-height: 1;
}
&.show {
background-color: rgba(255, 255, 255, 0.20);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .325);
}
@mixin display-hints($is-mobile: false) {
background-color: rgba(255, 255, 255, 0.15);
@if $is-mobile {
.dropdown-toggle-indicator {
display: inherit !important;
}
.dropdown-toggle:first-child {
padding-right: 30px !important;
}
}
}
&:hover {
@include display-hints;
}
/* smartphones and touchscreens */
@media (hover: none) and (pointer: coarse) {
@include display-hints($is-mobile: true);
/* fill space when on mobile */
max-width: calc(100% - 80px);
.dropdown-toggle {
max-width: 100%;
}
.logged-in-info {
max-width: calc(100% - 45px) !important;
}
}
.dropdown-toggle-indicator {
position: relative;
width: 0;
display: none;
span {
position: absolute;
right: -35px;
top: -8px;
color: grey;
width: $main-radius;
}
}
.dropdown-toggle {
&::after {
border: none;
}
}
.dropdown-toggle:first-child {
display: flex;
align-items: center;
padding: 5px 7px;
border-radius: $main-radius;
}
img {
@include avatar(34px);
margin-right: 10px;
}
.logged-in-info {
max-width: 105px;
flex-grow: 1;
.logged-in-display-name,
.logged-in-username {
@include ellipsis;
}
.logged-in-display-name {
font-size: 16px;
font-weight: $font-semibold;
color: pvar(--menuForegroundColor);
@include disable-default-a-behaviour;
}
.logged-in-username {
font-size: 13px;
color: #C6C6C6;
margin-top: 3px;
}
}
}
my-notification {
margin-left: auto;
margin-right: 15px;
}
}
}
.logged-in-menu {
.logged-in-more {
$main-radius: 25px;
flex: 1;
margin-left: 13px;
border-radius: $main-radius;
transition: all .1s ease-in-out;
cursor: pointer;
*, & {
line-height: 1;
}
&.show {
background-color: rgba(255, 255, 255, 0.20);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .325);
}
@mixin display-hints($is-mobile: false) {
background-color: rgba(255, 255, 255, 0.15);
@if $is-mobile {
.dropdown-toggle-indicator {
display: inherit !important;
}
.dropdown-toggle:first-child {
padding-right: 30px !important;
}
}
}
&:hover {
@include display-hints;
}
/* smartphones and touchscreens */
@media (hover: none) and (pointer: coarse) {
@include display-hints($is-mobile: true);
/* fill space when on mobile */
max-width: calc(100% - 80px);
.dropdown-toggle {
max-width: 100%;
}
.logged-in-info {
max-width: calc(100% - 45px) !important;
}
}
.dropdown-toggle-indicator {
position: relative;
width: 0;
display: none;
span {
position: absolute;
right: -35px;
top: -8px;
color: grey;
width: $main-radius;
}
}
.dropdown-toggle {
&::after {
border: none;
}
}
.dropdown-toggle:first-child {
display: flex;
flex-direction: column;
align-items: flex-start;
border-top: 1px solid var(--greyForegroundColor);
line-height: $line-height-normal;
align-items: center;
padding: 5px 7px;
border-radius: $main-radius;
}
a {
@include menu-link;
@include disable-default-a-behaviour;
img {
@include avatar(34px);
$icon-size: 13px;
$additional-margin: ($menu-link-icon-size - $icon-size) / 2;
margin-right: 10px;
}
}
font-size: 14px;
width: 100%;
min-height: 35px;
.logged-in-info {
max-width: 105px;
flex-grow: 1;
.logged-in-display-name,
.logged-in-username {
@include ellipsis;
}
.logged-in-display-name {
font-size: 16px;
font-weight: $font-semibold;
color: pvar(--menuForegroundColor);
@include disable-default-a-behaviour;
}
.logged-in-username {
font-size: 13px;
color: #C6C6C6;
margin-top: 3px;
}
}
.logged-in-menu {
display: flex;
flex-direction: column;
align-items: flex-start;
border-top: 1px solid var(--greyForegroundColor);
line-height: $line-height-normal;
a {
@include menu-link;
@include disable-default-a-behaviour;
$icon-size: 13px;
$additional-margin: ($menu-link-icon-size - $icon-size) / 2;
font-size: 14px;
width: 100%;
min-height: 35px;
my-global-icon {
width: $icon-size;
height: $icon-size;
// Keep aligned with other icons
margin-left: $additional-margin;
&[iconName="channel"] {
margin-top: -2px;
}
}
&.active,
&:hover,
&:focus-visible {
my-global-icon {
@include apply-svg-color(var(--menuForegroundColor));
}
}
&.active {
$border-left-width: 4px;
font-weight: $font-semibold;
border-left: $border-left-width solid var(--mainColor);
my-global-icon {
width: $icon-size;
height: $icon-size;
// Keep aligned with other icons
margin-left: $additional-margin;
&[iconName="channel"] {
margin-top: -2px;
}
}
&.active,
&:hover,
&:focus-visible {
my-global-icon {
@include apply-svg-color(var(--menuForegroundColor));
}
}
&.active {
$border-left-width: 4px;
font-weight: $font-semibold;
border-left: $border-left-width solid var(--mainColor);
my-global-icon {
margin-left: $additional-margin - $border-left-width;
}
margin-left: $additional-margin - $border-left-width;
}
}
}
@ -333,50 +334,48 @@ menu {
flex-direction: column;
padding: 0 $menu-lateral-padding;
}
}
$footer-links-base-opacity: .8;
.footer-links {
&, > div {
display: flex;
flex-wrap: wrap;
}
.footer-links {
&, > div {
display: flex;
flex-wrap: wrap;
}
a, span[role=button] {
display: inline-block;
text-decoration: none;
color: pvar(--menuForegroundColor);
opacity: $footer-links-base-opacity;
white-space: nowrap;
font-size: 90%;
font-weight: 500;
line-height: 1.4rem;
margin-right: 8px;
a, span[role=button] {
display: inline-block;
text-decoration: none;
color: pvar(--menuForegroundColor);
opacity: $footer-links-base-opacity;
&.inline-global-icon {
display: inline-flex;
align-items: center;
white-space: nowrap;
font-size: 90%;
font-weight: 500;
line-height: 1.4rem;
margin-right: 8px;
height: 1.4rem;
&.inline-global-icon {
display: inline-flex;
align-items: center;
white-space: nowrap;
height: 1.4rem;
my-global-icon {
@include apply-svg-color(pvar(--menuForegroundColor));
my-global-icon {
@include apply-svg-color(pvar(--menuForegroundColor));
display: flex;
width: auto;
height: 90%;
margin-right: .2rem;
}
display: flex;
width: auto;
height: 90%;
margin-right: .2rem;
}
}
}
}
.footer-copyleft small a {
@include disable-default-a-behaviour;
.footer-copyleft small a {
@include disable-default-a-behaviour;
color: pvar(--menuForegroundColor);
opacity: $footer-links-base-opacity - .2;
}
color: pvar(--menuForegroundColor);
opacity: $footer-links-base-opacity - .2;
}
.dropdown {

View File

@ -1,6 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<defs/>
<g fill="none" fill-rule="evenodd" stroke="#000" stroke-linecap="round" stroke-width="2">
<g fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-width="2">
<path stroke-linejoin="round" d="M8 17H5h0a4 4 0 111-7.9v-.6a5.5 5.5 0 0110.8-1.4A5 5 0 0123 12a5 5 0 01-5 5h-2"/>
<path d="M12 13v8"/>
<path stroke-linejoin="round" d="M15 20l-3 3-3-3"/>

Before

Width:  |  Height:  |  Size: 377 B

After

Width:  |  Height:  |  Size: 385 B

View File

@ -1,19 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<defs/>
<defs>
<linearGradient id="a" x1="50%" x2="50%" y1="0%" y2="97.33%">
<stop stop-color="#000" offset="0%"/>
<stop stop-color="#000" offset="100%" stop-opacity=".25"/>
</linearGradient>
<linearGradient id="b" x1="50%" x2="50%" y1="0%" y2="97.86%">
<stop stop-color="#000" offset="0%"/>
<stop stop-color="#000" offset="100%" stop-opacity=".25"/>
</linearGradient>
</defs>
<g fill="none" fill-rule="evenodd">
<circle cx="12" cy="10" r="3" fill="#000"/>
<path fill="url(#a)" fill-rule="nonzero" d="M16.39 13.85A5.68 5.68 0 0018 10c0-3.26-2.74-6-6-6s-6 2.74-6 6c0 1.42.58 2.7 1.62 3.85a.5.5 0 00.74-.67A4.7 4.7 0 017 10c0-2.7 2.3-5 5-5s5 2.3 5 5a4.7 4.7 0 01-1.36 3.18.5.5 0 10.75.67z"/>
<path fill="url(#b)" fill-rule="nonzero" d="M17.57 18.3A9.99 9.99 0 0012 0a10 10 0 00-5.56 18.31 1 1 0 101.11-1.66 7.99 7.99 0 118.9 0 1 1 0 101.12 1.66z"/>
<path fill="#000" d="M9.33 15.98A1.64 1.64 0 0111 14h2c1.1 0 1.85.88 1.67 1.98l-1 6.04c-.1.54-.61.98-1.17.98h-1c-.55 0-1.07-.43-1.16-.98l-1.01-6.04z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,7 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" transform="scale(1.2)" viewBox="0 0 200 200">
<defs/>
<path stroke="#000" stroke-width="3" d="M93 155H42a18 18 0 01-18-18V29a5 5 0 015-5h89a5 5 0 015 6L98 151a5 5 0 01-5 4zM34 34v103a8 8 0 008 8h47l22-111z"/>
<path stroke="#000" stroke-width="3" d="M171 176H75a5 5 0 01-5-6l4-21a5 5 0 0110 2l-3 15h85V63a8 8 0 00-8-8h-45a5 5 0 010-10h45a18 18 0 0118 18v108a5 5 0 01-5 5zM50 92h0a5 5 0 01-5-5V63a17 17 0 0135 0v24a5 5 0 01-10 0V62a7 7 0 00-15 0v25a5 5 0 01-5 5z"/>
<path stroke="#000" stroke-width="3" d="M75 76H50a5 5 0 010-10h25a5 5 0 010 10zM120 155a5 5 0 01-3-9l21-21h-18a5 5 0 010-10h30a5 5 0 014 9l-30 30a5 5 0 01-4 1z"/>
<path stroke="#000" stroke-width="3" d="M150 155a5 5 0 01-4-1l-14-15a5 5 0 017-7l15 14a5 5 0 01-4 9zM143 110h-15a5 5 0 110-10h15a5 5 0 010 10z"/>
<path stroke="currentColor" stroke-width="3" d="M93 155H42a18 18 0 01-18-18V29a5 5 0 015-5h89a5 5 0 015 6L98 151a5 5 0 01-5 4zM34 34v103a8 8 0 008 8h47l22-111z"/>
<path stroke="currentColor" stroke-width="3" d="M171 176H75a5 5 0 01-5-6l4-21a5 5 0 0110 2l-3 15h85V63a8 8 0 00-8-8h-45a5 5 0 010-10h45a18 18 0 0118 18v108a5 5 0 01-5 5zM50 92h0a5 5 0 01-5-5V63a17 17 0 0135 0v24a5 5 0 01-10 0V62a7 7 0 00-15 0v25a5 5 0 01-5 5z"/>
<path stroke="currentColor" stroke-width="3" d="M75 76H50a5 5 0 010-10h25a5 5 0 010 10zM120 155a5 5 0 01-3-9l21-21h-18a5 5 0 010-10h30a5 5 0 014 9l-30 30a5 5 0 01-4 1z"/>
<path stroke="currentColor" stroke-width="3" d="M150 155a5 5 0 01-4-1l-14-15a5 5 0 017-7l15 14a5 5 0 01-4 9zM143 110h-15a5 5 0 110-10h15a5 5 0 010 10z"/>
</svg>

Before

Width:  |  Height:  |  Size: 830 B

After

Width:  |  Height:  |  Size: 862 B

View File

@ -1,5 +1,5 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 18 7" style="transform: scale(1.3) translateY(1px);">
<path fill="#000" d="M0,0h18v6H9v1H5V6H0V0z M1,5h2V2h1v3h1V1H1V5z M6,1v5h2V5h2V1H6z M8,2h1v2H8V2z M11,1v4h2V2h1v3h1V2h1v3h1V1H11z"/>
<path fill="currentColor" d="M0,0h18v6H9v1H5V6H0V0z M1,5h2V2h1v3h1V1H1V5z M6,1v5h2V5h2V1H6z M8,2h1v2H8V2z M11,1v4h2V2h1v3h1V2h1v3h1V1H11z"/>
<polygon fill="#FFFFFF" points="1,5 3,5 3,2 4,2 4,5 5,5 5,1 1,1 "/>
<polygon fill="#FFFFFF" d="M6,1v5h2V5h2V1H6z M9,4H8V2h1V4z"/>
<polygon fill="#FFFFFF" points="11,1 11,5 13,5 13,2 14,2 14,5 15,5 15,2 16,2 16,5 17,5 17,1 "/>

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 552 B

View File

@ -1,20 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.st1{fill:#211F20;}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<style type="text/css">
.st0{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.st1{fill:currentColor;}
</style>
<line class="st0" x1="17.1" y1="9.5" x2="22.1" y2="14.5"/>
<line class="st0" x1="22.1" y1="9.5" x2="17.1" y2="14.5"/>
<g>
<line class="st0" x1="17.1" y1="9.5" x2="22.1" y2="14.5" />
<line class="st0" x1="22.1" y1="9.5" x2="17.1" y2="14.5" />
<g>
<g>
<path class="st1" d="M2,2.6V12l6.9-4.3"/>
<path class="st1" d="M2,12v9.4l6.9-5.2"/>
<path class="st1" d="M8.9,7.7v8.6l6.9-4.3"/>
<g>
<path class="st1" d="M2,2.6V12l6.9-4.3" />
<path class="st1" d="M2,12v9.4l6.9-5.2" />
<path class="st1" d="M8.9,7.7v8.6l6.9-4.3" />
</g>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 807 B

After

Width:  |  Height:  |  Size: 546 B

View File

@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 426.7 426.7">
<defs/>
<path fill="#000" d="M0 64h256v42.7H0zM0 149.3h256V192H0zM0 234.7h170.7v42.7H0z"/>
<path fill="#000" d="M341.3 234.7v-85.4h-42.6v85.4h-85.4v42.6h85.4v85.4h42.6v-85.4h85.4v-42.6z"/>
<path fill="currentColor" d="M0 64h256v42.7H0zM0 149.3h256V192H0zM0 234.7h170.7v42.7H0z"/>
<path fill="currentColor" d="M341.3 234.7v-85.4h-42.6v85.4h-85.4v42.6h85.4v85.4h42.6v-85.4h85.4v-42.6z"/>
</svg>

Before

Width:  |  Height:  |  Size: 269 B

After

Width:  |  Height:  |  Size: 285 B

View File

@ -6,9 +6,9 @@
<g transform="translate(2.669496,27.625894)">
<g transform="matrix(0.1,0,0,-0.1,0,511)">
<path d="m 3744.3542,4564.3712 c -217.4,-34.2 -520.3,-200.3 -693.7,-376.2 -263.8,-263.8 -388.4,-571.6 -388.4,-952.6 0,-256.5 44,-437.2 173.4,-684 75.7,-144.1 197.9,-280.9 747.5,-842.7 1106.5,-1133.40001 1138.2,-1165.20001 1253,-1194.50001 188.1,-51.3 214.9,-29.3 1162.7,938.00001 498.3,508.1 911.1,950.2 962.4,1030.8 263.8,415.3 283.3,964.9 48.8,1409.4 -180.8,342 -581.3,620.4 -972.2,676.6 -332.2,48.9 -671.7,-36.6 -967.3,-236.9 l -156.3,-109.9 -119.7,87.9 c -158.8,117.2 -351.8,202.7 -554.5,244.3 -183.1,39.1 -295.4,41.6 -495.7,9.8 z"
fill="#000"/>
fill="currentColor"/>
<path d="m 7991.4051,47.633899 c -39.1,-19.5 -473.9,-437.299999 -964.9,-925.800029 l -891.6,-891.59997 h -830.5 c -757.2,0 -837.8,4.9 -913.6,44 -207.6,112.4 -227.2,415.2 -39.1,561.8 66,53.7 83,53.7 950.2,53.7 989.3,0 1008.8,2.5 1094.3,173.49997 56.2,105 56.2,317.50003 4.9,427.50003 -83.1,175.9 4.8,168.5 -1915.1,168.5 h -1722 l -173.4,-63.5 c -95.3,-34.2 -232.1,-102.6 -305.3,-151.5 -73.3,-48.9 -442.1,-400.60003 -823.2,-779.2 l -688.80006,-693.7 664.40006,-647.3 c 366.4,-354.2 779.2,-754.8 918.4,-889.1 l 251.6,-241.8 481.2,481.2 481.2,481.2 h 1487.6 c 1294.6,0 1494.9,4.9 1565.8,39.1 58.6,26.9 339.6,368.8 1028.4,1248.2 522.8,666.89997 964.9,1243.3 982,1284.9 41.5,92.8 2.5,212.499999 -95.3,297.999999 -66,53.7 -95.3,61.1 -273.6,61.1 -132,-0.1 -224.8,-12.3 -273.6,-39.2 z"
fill="#000"/>
fill="currentColor"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1,7 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" transform="scale(1.1)" viewBox="0 0 24 24">
<defs/>
<g class="layer">
<path fill="#fff" fill-rule="evenodd" stroke="#000" stroke-width="1.8" d="M20.5 6.7s-.2-1.4-.8-2c-.7-.8-1.6-.8-2-.9-2.7-.2-6.9-.2-6.9-.2h0s-4.2 0-7 .2c-.3 0-1.2 0-2 .9-.5.6-.7 2-.7 2L.9 10v1.6l.2 3.3s.2 1.4.8 2c.7.8 1.7.8 2.2.9 1.6.2 6.7.2 6.7.2s4.2 0 7-.2c.3 0 1.2 0 2-.9.5-.6.7-2 .7-2l.2-3.3V10l-.2-3.3h0z"/>
<path fill="#fff" fill-rule="evenodd" stroke="currentColor" stroke-width="1.8" d="M20.5 6.7s-.2-1.4-.8-2c-.7-.8-1.6-.8-2-.9-2.7-.2-6.9-.2-6.9-.2h0s-4.2 0-7 .2c-.3 0-1.2 0-2 .9-.5.6-.7 2-.7 2L.9 10v1.6l.2 3.3s.2 1.4.8 2c.7.8 1.7.8 2.2.9 1.6.2 6.7.2 6.7.2s4.2 0 7-.2c.3 0 1.2 0 2-.9.5-.6.7-2 .7-2l.2-3.3V10l-.2-3.3h0z"/>
<path d="M8.7 14.7a.7.7 0 01-.5-1.2l2.9-3H8.7a.7.7 0 010-1.3h4a.7.7 0 01.5 1.2l-4 4a.7.7 0 01-.5.3zM11.7 8.6h-2a.7.7 0 110-1.4h2a.7.7 0 010 1.4z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 595 B

After

Width:  |  Height:  |  Size: 603 B

View File

@ -41,9 +41,6 @@
word-break: break-word;
word-wrap: break-word;
overflow-wrap: break-word;
-webkit-hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
@ -52,28 +49,6 @@
::ng-deep .material {
color: $color;
}
::ng-deep svg {
path[fill="#000"],
g[fill="#000"],
rect[fill="#000"],
circle[fill="#000"],
polygon[fill="#000"] {
fill: $color;
}
path[stroke="#000"],
g[stroke="#000"],
rect[stroke="#000"],
circle[stroke="#000"],
polygon[stroke="#000"] {
stroke: $color;
}
stop[stop-color="#000"] {
stop-color: $color;
}
}
}
@mixin fill-svg-color ($color) {