Add URL params to control fonts
This was also a good chance to switch to the semantic font size names used in Compound.
This commit is contained in:
		
					parent
					
						
							
								e6e18dd3f9
							
						
					
				
			
			
				commit
				
					
						acc41c532e
					
				
			
		
					 19 changed files with 156 additions and 58 deletions
				
			
		| 
						 | 
					@ -131,7 +131,7 @@
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .leftNav h3 {
 | 
					  .leftNav h3 {
 | 
				
			||||||
    font-size: 18px;
 | 
					    font-size: var(--font-size-subtitle);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .nav {
 | 
					  .nav {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,7 +19,7 @@
 | 
				
			||||||
  padding: 8px 16px;
 | 
					  padding: 8px 16px;
 | 
				
			||||||
  outline: none;
 | 
					  outline: none;
 | 
				
			||||||
  cursor: pointer;
 | 
					  cursor: pointer;
 | 
				
			||||||
  font-size: 15px;
 | 
					  font-size: var(--font-size-body);
 | 
				
			||||||
  min-height: 32px;
 | 
					  min-height: 32px;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,7 +12,10 @@
 | 
				
			||||||
  align-items: center;
 | 
					  align-items: center;
 | 
				
			||||||
  padding: 0 12px;
 | 
					  padding: 0 12px;
 | 
				
			||||||
  color: var(--primary-content);
 | 
					  color: var(--primary-content);
 | 
				
			||||||
  font-size: 14px;
 | 
					  font-size: var(--font-size-body);
 | 
				
			||||||
 | 
					  text-overflow: ellipsis;
 | 
				
			||||||
 | 
					  overflow: hidden;
 | 
				
			||||||
 | 
					  white-space: nowrap;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.menuItem > * {
 | 
					.menuItem > * {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,7 +29,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.modalHeader h3 {
 | 
					.modalHeader h3 {
 | 
				
			||||||
  font-weight: 600;
 | 
					  font-weight: 600;
 | 
				
			||||||
  font-size: 24px;
 | 
					  font-size: var(--font-size-title);
 | 
				
			||||||
  margin: 0;
 | 
					  margin: 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,7 +8,7 @@
 | 
				
			||||||
  border-radius: 8px;
 | 
					  border-radius: 8px;
 | 
				
			||||||
  max-width: 135px;
 | 
					  max-width: 135px;
 | 
				
			||||||
  width: max-content;
 | 
					  width: max-content;
 | 
				
			||||||
  font-size: 12px;
 | 
					  font-size: var(--font-size-caption);
 | 
				
			||||||
  font-weight: 500;
 | 
					  font-weight: 500;
 | 
				
			||||||
  text-align: center;
 | 
					  text-align: center;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -21,30 +21,60 @@ export interface UrlParams {
 | 
				
			||||||
  roomAlias: string | null;
 | 
					  roomAlias: string | null;
 | 
				
			||||||
  roomId: string | null;
 | 
					  roomId: string | null;
 | 
				
			||||||
  viaServers: string[];
 | 
					  viaServers: string[];
 | 
				
			||||||
  // Whether the app is running in embedded mode, and should keep the user
 | 
					  /**
 | 
				
			||||||
  // confined to the current room
 | 
					   * Whether the app is running in embedded mode, and should keep the user
 | 
				
			||||||
 | 
					   * confined to the current room.
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
  isEmbedded: boolean;
 | 
					  isEmbedded: boolean;
 | 
				
			||||||
  // Whether the app should pause before joining the call until it sees an
 | 
					  /**
 | 
				
			||||||
  // io.element.join widget action, allowing it to be preloaded
 | 
					   * Whether the app should pause before joining the call until it sees an
 | 
				
			||||||
 | 
					   * io.element.join widget action, allowing it to be preloaded.
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
  preload: boolean;
 | 
					  preload: boolean;
 | 
				
			||||||
  // Whether to hide the room header when in a call
 | 
					  /**
 | 
				
			||||||
 | 
					   * Whether to hide the room header when in a call.
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
  hideHeader: boolean;
 | 
					  hideHeader: boolean;
 | 
				
			||||||
  // Whether to hide the screen-sharing button
 | 
					  /**
 | 
				
			||||||
 | 
					   * Whether to hide the screen-sharing button.
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
  hideScreensharing: boolean;
 | 
					  hideScreensharing: boolean;
 | 
				
			||||||
  // Whether to start a walkie-talkie call instead of a video call
 | 
					  /**
 | 
				
			||||||
 | 
					   * Whether to start a walkie-talkie call instead of a video call.
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
  isPtt: boolean;
 | 
					  isPtt: boolean;
 | 
				
			||||||
  // Whether to use end-to-end encryption
 | 
					  /**
 | 
				
			||||||
 | 
					   * Whether to use end-to-end encryption.
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
  e2eEnabled: boolean;
 | 
					  e2eEnabled: boolean;
 | 
				
			||||||
  // The user's ID (only used in matryoshka mode)
 | 
					  /**
 | 
				
			||||||
 | 
					   * The user's ID (only used in matryoshka mode).
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
  userId: string | null;
 | 
					  userId: string | null;
 | 
				
			||||||
  // The display name to use for auto-registration
 | 
					  /**
 | 
				
			||||||
 | 
					   * The display name to use for auto-registration.
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
  displayName: string | null;
 | 
					  displayName: string | null;
 | 
				
			||||||
  // The device's ID (only used in matryoshka mode)
 | 
					  /**
 | 
				
			||||||
 | 
					   * The device's ID (only used in matryoshka mode).
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
  deviceId: string | null;
 | 
					  deviceId: string | null;
 | 
				
			||||||
  // The base URL of the homeserver to use for media lookups in matryoshka mode
 | 
					  /**
 | 
				
			||||||
 | 
					   * The base URL of the homeserver to use for media lookups in matryoshka mode.
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
  baseUrl: string | null;
 | 
					  baseUrl: string | null;
 | 
				
			||||||
  // The BCP 47 code of the language the app should use
 | 
					  /**
 | 
				
			||||||
 | 
					   * The BCP 47 code of the language the app should use.
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
  lang: string | null;
 | 
					  lang: string | null;
 | 
				
			||||||
 | 
					  /**
 | 
				
			||||||
 | 
					   * The fonts which the interface should use, if not empty.
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
 | 
					  fonts: string[];
 | 
				
			||||||
 | 
					  /**
 | 
				
			||||||
 | 
					   * The factor by which to scale the interface's font size.
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
 | 
					  fontScale: number | null;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
| 
						 | 
					@ -81,6 +111,8 @@ export const getUrlParams = (
 | 
				
			||||||
      ? fragment
 | 
					      ? fragment
 | 
				
			||||||
      : fragment.substring(0, fragmentQueryStart);
 | 
					      : fragment.substring(0, fragmentQueryStart);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const fontScale = parseFloat(getParam("fontScale") ?? "");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return {
 | 
					  return {
 | 
				
			||||||
    roomAlias: fragmentRoute.length > 1 ? fragmentRoute : null,
 | 
					    roomAlias: fragmentRoute.length > 1 ? fragmentRoute : null,
 | 
				
			||||||
    roomId: getParam("roomId"),
 | 
					    roomId: getParam("roomId"),
 | 
				
			||||||
| 
						 | 
					@ -96,6 +128,8 @@ export const getUrlParams = (
 | 
				
			||||||
    deviceId: getParam("deviceId"),
 | 
					    deviceId: getParam("deviceId"),
 | 
				
			||||||
    baseUrl: getParam("baseUrl"),
 | 
					    baseUrl: getParam("baseUrl"),
 | 
				
			||||||
    lang: getParam("lang"),
 | 
					    lang: getParam("lang"),
 | 
				
			||||||
 | 
					    fonts: getAllParams("font"),
 | 
				
			||||||
 | 
					    fontScale: Number.isNaN(fontScale) ? null : fontScale,
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,13 +10,13 @@
 | 
				
			||||||
.avatar {
 | 
					.avatar {
 | 
				
			||||||
  width: 24px;
 | 
					  width: 24px;
 | 
				
			||||||
  height: 24px;
 | 
					  height: 24px;
 | 
				
			||||||
  font-size: 12px;
 | 
					  font-size: var(--font-size-caption);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@media (min-width: 800px) {
 | 
					@media (min-width: 800px) {
 | 
				
			||||||
  .avatar {
 | 
					  .avatar {
 | 
				
			||||||
    width: 32px;
 | 
					    width: 32px;
 | 
				
			||||||
    height: 32px;
 | 
					    height: 32px;
 | 
				
			||||||
    font-size: 15px;
 | 
					    font-size: var(--font-size-body);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,7 +36,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.formContainer h4 {
 | 
					.formContainer h4 {
 | 
				
			||||||
  font-weight: normal;
 | 
					  font-weight: normal;
 | 
				
			||||||
  font-size: 18px;
 | 
					  font-size: var(--font-size-subtitle);
 | 
				
			||||||
  margin-bottom: 0;
 | 
					  margin-bottom: 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,7 +48,7 @@
 | 
				
			||||||
.formContainer button {
 | 
					.formContainer button {
 | 
				
			||||||
  height: 48px;
 | 
					  height: 48px;
 | 
				
			||||||
  width: 100%;
 | 
					  width: 100%;
 | 
				
			||||||
  font-size: 15px;
 | 
					  font-size: var(--font-size-body);
 | 
				
			||||||
  font-weight: 600;
 | 
					  font-weight: 600;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -61,7 +61,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.authLinks {
 | 
					.authLinks {
 | 
				
			||||||
  margin-bottom: 100px;
 | 
					  margin-bottom: 100px;
 | 
				
			||||||
  font-size: 15px;
 | 
					  font-size: var(--font-size-body);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.authLinks a {
 | 
					.authLinks a {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -41,7 +41,7 @@ limitations under the License.
 | 
				
			||||||
.copyButton {
 | 
					.copyButton {
 | 
				
			||||||
  padding: 7px 15px;
 | 
					  padding: 7px 15px;
 | 
				
			||||||
  border-radius: 8px;
 | 
					  border-radius: 8px;
 | 
				
			||||||
  font-size: 14px;
 | 
					  font-size: var(--font-size-body);
 | 
				
			||||||
  font-weight: 700;
 | 
					  font-weight: 700;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -142,7 +142,7 @@ limitations under the License.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.copyButton span {
 | 
					.copyButton span {
 | 
				
			||||||
  font-weight: 600;
 | 
					  font-weight: 600;
 | 
				
			||||||
  font-size: 15px;
 | 
					  font-size: var(--font-size-body);
 | 
				
			||||||
  margin-right: 10px;
 | 
					  margin-right: 10px;
 | 
				
			||||||
  overflow: hidden;
 | 
					  overflow: hidden;
 | 
				
			||||||
  white-space: nowrap;
 | 
					  white-space: nowrap;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -23,8 +23,20 @@ limitations under the License.
 | 
				
			||||||
@import "normalize.css/normalize.css";
 | 
					@import "normalize.css/normalize.css";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
:root {
 | 
					:root {
 | 
				
			||||||
 | 
					  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
 | 
				
			||||||
 | 
					    "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
 | 
				
			||||||
 | 
					    "Helvetica Neue", sans-serif;
 | 
				
			||||||
  --inter-unicode-range: U+0000-20e2, U+20e4-23ce, U+23d0-24c1, U+24c3-259f,
 | 
					  --inter-unicode-range: U+0000-20e2, U+20e4-23ce, U+23d0-24c1, U+24c3-259f,
 | 
				
			||||||
    U+25c2-2664, U+2666-2763, U+2765-2b05, U+2b07-2b1b, U+2b1d-10FFFF;
 | 
					    U+25c2-2664, U+2666-2763, U+2765-2b05, U+2b07-2b1b, U+2b1d-10FFFF;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  --font-scale: 1;
 | 
				
			||||||
 | 
					  --font-size-micro: calc(10px * var(--font-scale));
 | 
				
			||||||
 | 
					  --font-size-caption: calc(12px * var(--font-scale));
 | 
				
			||||||
 | 
					  --font-size-body: calc(15px * var(--font-scale));
 | 
				
			||||||
 | 
					  --font-size-subtitle: calc(18px * var(--font-scale));
 | 
				
			||||||
 | 
					  --font-size-title: calc(24px * var(--font-scale));
 | 
				
			||||||
 | 
					  --font-size-headline: calc(32px * var(--font-scale));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  --accent: #0dbd8b;
 | 
					  --accent: #0dbd8b;
 | 
				
			||||||
  --accent-20: #0dbd8b33;
 | 
					  --accent-20: #0dbd8b33;
 | 
				
			||||||
  --alert: #ff5b55;
 | 
					  --alert: #ff5b55;
 | 
				
			||||||
| 
						 | 
					@ -127,9 +139,7 @@ body {
 | 
				
			||||||
  color: var(--primary-content);
 | 
					  color: var(--primary-content);
 | 
				
			||||||
  color-scheme: dark;
 | 
					  color-scheme: dark;
 | 
				
			||||||
  margin: 0;
 | 
					  margin: 0;
 | 
				
			||||||
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
 | 
					  font-family: var(--font-family);
 | 
				
			||||||
    "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
 | 
					 | 
				
			||||||
    sans-serif;
 | 
					 | 
				
			||||||
  -webkit-font-smoothing: antialiased;
 | 
					  -webkit-font-smoothing: antialiased;
 | 
				
			||||||
  -moz-osx-font-smoothing: grayscale;
 | 
					  -moz-osx-font-smoothing: grayscale;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -159,28 +169,31 @@ a {
 | 
				
			||||||
/* Headline Semi Bold */
 | 
					/* Headline Semi Bold */
 | 
				
			||||||
h1 {
 | 
					h1 {
 | 
				
			||||||
  font-weight: 600;
 | 
					  font-weight: 600;
 | 
				
			||||||
  font-size: 32px;
 | 
					  font-size: var(--font-size-headline);
 | 
				
			||||||
  line-height: 39px;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Title */
 | 
					/* Title */
 | 
				
			||||||
h2 {
 | 
					h2 {
 | 
				
			||||||
  font-weight: 600;
 | 
					  font-weight: 600;
 | 
				
			||||||
  font-size: 24px;
 | 
					  font-size: var(--font-size-title);
 | 
				
			||||||
  line-height: 29px;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Subtitle */
 | 
					/* Subtitle */
 | 
				
			||||||
h3 {
 | 
					h3 {
 | 
				
			||||||
  font-weight: 400;
 | 
					  font-weight: 400;
 | 
				
			||||||
  font-size: 18px;
 | 
					  font-size: var(--font-size-subtitle);
 | 
				
			||||||
  line-height: 22px;
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					h1,
 | 
				
			||||||
 | 
					h2,
 | 
				
			||||||
 | 
					h3 {
 | 
				
			||||||
 | 
					  line-height: 1.2;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Body */
 | 
					/* Body */
 | 
				
			||||||
p {
 | 
					p {
 | 
				
			||||||
  font-size: 15px;
 | 
					  font-size: var(--font-size-body);
 | 
				
			||||||
  line-height: 24px;
 | 
					  line-height: var(--font-size-title);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
a {
 | 
					a {
 | 
				
			||||||
| 
						 | 
					@ -202,21 +215,21 @@ hr {
 | 
				
			||||||
  text-align: center;
 | 
					  text-align: center;
 | 
				
			||||||
  height: 5px;
 | 
					  height: 5px;
 | 
				
			||||||
  font-weight: 600;
 | 
					  font-weight: 600;
 | 
				
			||||||
  font-size: 15px;
 | 
					  font-size: var(--font-size-body);
 | 
				
			||||||
  line-height: 24px;
 | 
					  line-height: 24px;
 | 
				
			||||||
  margin: 0 12px;
 | 
					  margin: 0 12px;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
summary {
 | 
					summary {
 | 
				
			||||||
  font-size: 14px;
 | 
					  font-size: var(--font-size-body);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
details > :not(summary) {
 | 
					details > :not(summary) {
 | 
				
			||||||
  margin-left: 16px;
 | 
					  margin-left: var(--font-size-body);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
details[open] > summary {
 | 
					details[open] > summary {
 | 
				
			||||||
  margin-bottom: 16px;
 | 
					  margin-bottom: var(--font-size-body);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#root > [data-overlay-container] {
 | 
					#root > [data-overlay-container] {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -133,6 +133,21 @@ export class Initializer {
 | 
				
			||||||
        import.meta.env.VITE_THEME_BACKGROUND_85 as string
 | 
					        import.meta.env.VITE_THEME_BACKGROUND_85 as string
 | 
				
			||||||
      );
 | 
					      );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Custom fonts
 | 
				
			||||||
 | 
					    const { fonts, fontScale } = getUrlParams();
 | 
				
			||||||
 | 
					    if (fontScale !== null) {
 | 
				
			||||||
 | 
					      document.documentElement.style.setProperty(
 | 
				
			||||||
 | 
					        "--font-scale",
 | 
				
			||||||
 | 
					        fontScale.toString()
 | 
				
			||||||
 | 
					      );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if (fonts.length > 0) {
 | 
				
			||||||
 | 
					      document.documentElement.style.setProperty(
 | 
				
			||||||
 | 
					        "--font-family",
 | 
				
			||||||
 | 
					        fonts.map((f) => `"${f}"`).join(", ")
 | 
				
			||||||
 | 
					      );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  public static init(): Promise<void> | null {
 | 
					  public static init(): Promise<void> | null {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,7 +32,7 @@
 | 
				
			||||||
.inputField input,
 | 
					.inputField input,
 | 
				
			||||||
.inputField textarea {
 | 
					.inputField textarea {
 | 
				
			||||||
  font-weight: 400;
 | 
					  font-weight: 400;
 | 
				
			||||||
  font-size: 15px;
 | 
					  font-size: var(--font-size-body);
 | 
				
			||||||
  border: none;
 | 
					  border: none;
 | 
				
			||||||
  border-radius: 4px;
 | 
					  border-radius: 4px;
 | 
				
			||||||
  padding: 12px 9px 10px 9px;
 | 
					  padding: 12px 9px 10px 9px;
 | 
				
			||||||
| 
						 | 
					@ -73,7 +73,7 @@
 | 
				
			||||||
    top 0.25s ease-out 0.1s, background-color 0.25s ease-out 0.1s;
 | 
					    top 0.25s ease-out 0.1s, background-color 0.25s ease-out 0.1s;
 | 
				
			||||||
  color: var(--tertiary-content);
 | 
					  color: var(--tertiary-content);
 | 
				
			||||||
  background-color: transparent;
 | 
					  background-color: transparent;
 | 
				
			||||||
  font-size: 15px;
 | 
					  font-size: var(--font-size-body);
 | 
				
			||||||
  position: absolute;
 | 
					  position: absolute;
 | 
				
			||||||
  left: 0;
 | 
					  left: 0;
 | 
				
			||||||
  top: 0;
 | 
					  top: 0;
 | 
				
			||||||
| 
						 | 
					@ -104,7 +104,7 @@
 | 
				
			||||||
  background-color: var(--system);
 | 
					  background-color: var(--system);
 | 
				
			||||||
  transition: font-size 0.25s ease-out 0s, color 0.25s ease-out 0s,
 | 
					  transition: font-size 0.25s ease-out 0s, color 0.25s ease-out 0s,
 | 
				
			||||||
    top 0.25s ease-out 0s, background-color 0.25s ease-out 0s;
 | 
					    top 0.25s ease-out 0s, background-color 0.25s ease-out 0s;
 | 
				
			||||||
  font-size: 10px;
 | 
					  font-size: var(--font-size-micro);
 | 
				
			||||||
  top: -13px;
 | 
					  top: -13px;
 | 
				
			||||||
  padding: 0 2px;
 | 
					  padding: 0 2px;
 | 
				
			||||||
  pointer-events: auto;
 | 
					  pointer-events: auto;
 | 
				
			||||||
| 
						 | 
					@ -125,7 +125,7 @@
 | 
				
			||||||
  display: flex;
 | 
					  display: flex;
 | 
				
			||||||
  align-items: center;
 | 
					  align-items: center;
 | 
				
			||||||
  flex-grow: 1;
 | 
					  flex-grow: 1;
 | 
				
			||||||
  font-size: 15px;
 | 
					  font-size: var(--font-size-body);
 | 
				
			||||||
  line-height: 24px;
 | 
					  line-height: 24px;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -174,7 +174,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.errorMessage {
 | 
					.errorMessage {
 | 
				
			||||||
  margin: 0;
 | 
					  margin: 0;
 | 
				
			||||||
  font-size: 13px;
 | 
					  font-size: var(--font-size-caption);
 | 
				
			||||||
  color: var(--alert);
 | 
					  color: var(--alert);
 | 
				
			||||||
  font-weight: 600;
 | 
					  font-weight: 600;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.label {
 | 
					.label {
 | 
				
			||||||
  font-weight: 600;
 | 
					  font-weight: 600;
 | 
				
			||||||
  font-size: 18px;
 | 
					  font-size: var(--font-size-subtitle);
 | 
				
			||||||
  margin-top: 0;
 | 
					  margin-top: 0;
 | 
				
			||||||
  margin-bottom: 12px;
 | 
					  margin-bottom: 12px;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -20,7 +20,7 @@
 | 
				
			||||||
  background-color: var(--background);
 | 
					  background-color: var(--background);
 | 
				
			||||||
  border-radius: 8px;
 | 
					  border-radius: 8px;
 | 
				
			||||||
  border: 1px solid var(--quinary-content);
 | 
					  border: 1px solid var(--quinary-content);
 | 
				
			||||||
  font-size: 15px;
 | 
					  font-size: var(--font-size-body);
 | 
				
			||||||
  color: var(--primary-content);
 | 
					  color: var(--primary-content);
 | 
				
			||||||
  height: 40px;
 | 
					  height: 40px;
 | 
				
			||||||
  max-width: 100%;
 | 
					  max-width: 100%;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -19,7 +19,7 @@
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.sequenceDiagramViewer :global(.messageText) {
 | 
					.sequenceDiagramViewer :global(.messageText) {
 | 
				
			||||||
  font-size: 12px;
 | 
					  font-size: var(--font-size-caption);
 | 
				
			||||||
  fill: var(--primary-content) !important;
 | 
					  fill: var(--primary-content) !important;
 | 
				
			||||||
  stroke: var(--primary-content) !important;
 | 
					  stroke: var(--primary-content) !important;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -54,7 +54,7 @@ limitations under the License.
 | 
				
			||||||
  bottom: 86px;
 | 
					  bottom: 86px;
 | 
				
			||||||
  left: 50%;
 | 
					  left: 50%;
 | 
				
			||||||
  font-weight: 600;
 | 
					  font-weight: 600;
 | 
				
			||||||
  font-size: 15px;
 | 
					  font-size: var(--font-size-body);
 | 
				
			||||||
  transform: translateX(-50%);
 | 
					  transform: translateX(-50%);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -64,7 +64,7 @@
 | 
				
			||||||
.actionTip {
 | 
					.actionTip {
 | 
				
			||||||
  margin-top: 20px;
 | 
					  margin-top: 20px;
 | 
				
			||||||
  margin-bottom: 20px;
 | 
					  margin-bottom: 20px;
 | 
				
			||||||
  font-size: 17px;
 | 
					  font-size: var(--font-size-subtitle);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.footer {
 | 
					.footer {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,11 +1,11 @@
 | 
				
			||||||
.caption {
 | 
					.caption {
 | 
				
			||||||
  font-size: 12px;
 | 
					  font-size: var(--font-size-caption);
 | 
				
			||||||
  line-height: 15px;
 | 
					  line-height: var(--font-size-body);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.micro {
 | 
					.micro {
 | 
				
			||||||
  font-size: 10px;
 | 
					  font-size: var(--font-size-micro);
 | 
				
			||||||
  line-height: 12px;
 | 
					  line-height: var(--font-size-caption);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.regular {
 | 
					.regular {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -119,9 +119,9 @@
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.memberName span {
 | 
					.memberName span {
 | 
				
			||||||
  font-size: 12px;
 | 
					  font-size: var(--font-size-caption);
 | 
				
			||||||
  font-weight: 400;
 | 
					  font-weight: 400;
 | 
				
			||||||
  line-height: 16px;
 | 
					  line-height: var(--font-size-body);
 | 
				
			||||||
  text-overflow: ellipsis;
 | 
					  text-overflow: ellipsis;
 | 
				
			||||||
  overflow: hidden;
 | 
					  overflow: hidden;
 | 
				
			||||||
  white-space: nowrap;
 | 
					  white-space: nowrap;
 | 
				
			||||||
| 
						 | 
					@ -152,8 +152,8 @@
 | 
				
			||||||
  align-items: center;
 | 
					  align-items: center;
 | 
				
			||||||
  padding: 4px 8px;
 | 
					  padding: 4px 8px;
 | 
				
			||||||
  font-weight: normal;
 | 
					  font-weight: normal;
 | 
				
			||||||
  font-size: 12px;
 | 
					  font-size: var(--font-size-caption);
 | 
				
			||||||
  line-height: 15px;
 | 
					  line-height: var(--font-size-body);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.screensharePIP {
 | 
					.screensharePIP {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										33
									
								
								test/initializer-test.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								test/initializer-test.ts
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,33 @@
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
 | 
					Copyright 2022 New Vector Ltd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					You may obtain a copy of the License at
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					limitations under the License.
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import { Initializer } from "../src/initializer";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test("initBeforeReact sets font family from URL param", () => {
 | 
				
			||||||
 | 
					  window.location.hash = "#?font=DejaVu Sans";
 | 
				
			||||||
 | 
					  Initializer.initBeforeReact();
 | 
				
			||||||
 | 
					  expect(
 | 
				
			||||||
 | 
					    getComputedStyle(document.documentElement).getPropertyValue("--font-family")
 | 
				
			||||||
 | 
					  ).toBe('"DejaVu Sans"');
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test("initBeforeReact sets font scale from URL param", () => {
 | 
				
			||||||
 | 
					  window.location.hash = "#?fontScale=1.2";
 | 
				
			||||||
 | 
					  Initializer.initBeforeReact();
 | 
				
			||||||
 | 
					  expect(
 | 
				
			||||||
 | 
					    getComputedStyle(document.documentElement).getPropertyValue("--font-scale")
 | 
				
			||||||
 | 
					  ).toBe("1.2");
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue