Sfoglia il codice sorgente

Varia: Cleanup comment metadata to support word-breaks on longer usernames in comments.

Allan Cole 5 anni fa
parent
commit
adf9e66933
3 ha cambiato i file con 74 aggiunte e 32 eliminazioni
  1. 29 14
      varia/sass/components/comments/_comments.scss
  2. 20 0
      varia/style-rtl.css
  3. 25 18
      varia/style.css

+ 29 - 14
varia/sass/components/comments/_comments.scss

@@ -81,28 +81,20 @@
 
 	margin-right: calc( $avatar-size + (0.5 * #{map-deep-get($config-global, "spacing", "horizontal")}) );
 
-	@include media(mobile) {
-		margin-right: inherit;
-	}
-
 	.comment-author {
 
-		@include media(mobile) {
-			display: flex;
-			align-items: center;
+		max-width: calc(100% - #{3 * map-deep-get($config-global, "spacing", "horizontal")});
+
+		.fn {
+			word-wrap: break-word;
+			word-break: break-word;
+			hyphens: auto;
 		}
 
 		.avatar {
 			display: block;
 			position: absolute;
 			right: 0;
-
-			@include media(mobile) {
-				margin-right: #{map-deep-get($config-global, "spacing", "horizontal")};
-				display: inherit;
-				position: inherit;
-				right: inherit;
-			}
 		}
 	}
 
@@ -121,9 +113,32 @@
 	}
 
 	@include media(mobile) {
+		margin-right: inherit;
 		align-items: center;
 		display: flex;
 		justify-content: space-between;
+
+		.comment-author {
+			display: flex;
+			align-items: center;
+			max-width: inherit;
+			flex: 0 1 auto;
+
+			.fn {
+				padding-right: #{map-deep-get($config-global, "spacing", "horizontal")};
+			}
+
+			.avatar {
+				margin-right: #{map-deep-get($config-global, "spacing", "horizontal")};
+				display: inherit;
+				position: inherit;
+				right: inherit;
+			}
+		}
+
+		.comment-metadata {
+			flex: 0 1 auto;
+		}
 	}
 }
 

+ 20 - 0
varia/style-rtl.css

@@ -2969,6 +2969,16 @@ body:not(.fse-enabled) .footer-menu a {
 	}
 }
 
+.comment-meta .comment-author {
+	max-width: calc(100% - 48px);
+}
+
+.comment-meta .comment-author .fn {
+	word-wrap: break-word;
+	word-break: break-word;
+	hyphens: auto;
+}
+
 @media only screen and (min-width: 560px) {
 	.comment-meta .comment-author {
 		display: flex;
@@ -3009,6 +3019,16 @@ body:not(.fse-enabled) .footer-menu a {
 		display: flex;
 		justify-content: space-between;
 	}
+	.comment-meta .comment-author {
+		max-width: inherit;
+		flex: 0 1 auto;
+	}
+	.comment-meta .comment-author .fn {
+		padding-left: 16px;
+	}
+	.comment-meta .comment-metadata {
+		flex: 0 1 auto;
+	}
 }
 
 .comment-metadata,

+ 25 - 18
varia/style.css

@@ -2980,17 +2980,14 @@ body:not(.fse-enabled) .footer-menu a {
 	margin-right: calc( $avatar-size + (0.5 * 16px));
 }
 
-@media only screen and (min-width: 560px) {
-	.comment-meta {
-		margin-right: inherit;
-	}
+.comment-meta .comment-author {
+	max-width: calc(100% - 48px);
 }
 
-@media only screen and (min-width: 560px) {
-	.comment-meta .comment-author {
-		display: flex;
-		align-items: center;
-	}
+.comment-meta .comment-author .fn {
+	word-wrap: break-word;
+	word-break: break-word;
+	hyphens: auto;
 }
 
 .comment-meta .comment-author .avatar {
@@ -2999,15 +2996,6 @@ body:not(.fse-enabled) .footer-menu a {
 	right: 0;
 }
 
-@media only screen and (min-width: 560px) {
-	.comment-meta .comment-author .avatar {
-		margin-right: 16px;
-		display: inherit;
-		position: inherit;
-		right: inherit;
-	}
-}
-
 .comment-meta .comment-metadata {
 	color: #444444;
 }
@@ -3022,10 +3010,29 @@ body:not(.fse-enabled) .footer-menu a {
 
 @media only screen and (min-width: 560px) {
 	.comment-meta {
+		margin-right: inherit;
 		align-items: center;
 		display: flex;
 		justify-content: space-between;
 	}
+	.comment-meta .comment-author {
+		display: flex;
+		align-items: center;
+		max-width: inherit;
+		flex: 0 1 auto;
+	}
+	.comment-meta .comment-author .fn {
+		padding-right: 16px;
+	}
+	.comment-meta .comment-author .avatar {
+		margin-right: 16px;
+		display: inherit;
+		position: inherit;
+		right: inherit;
+	}
+	.comment-meta .comment-metadata {
+		flex: 0 1 auto;
+	}
 }
 
 .comment-metadata,