Timothy J. Baek 9 月之前
父節點
當前提交
c44e51ae58
共有 2 個文件被更改,包括 5 次插入8 次删除
  1. 4 0
      src/app.css
  2. 1 8
      src/lib/components/common/SensitiveInput.svelte

+ 4 - 0
src/app.css

@@ -154,3 +154,7 @@ input[type='number'] {
 .tippy-box[data-theme~='dark'] {
 	@apply rounded-lg bg-gray-950 text-xs border border-gray-900 shadow-xl;
 }
+
+.password {
+	-webkit-text-security: disc;
+}

+ 1 - 8
src/lib/components/common/SensitiveInput.svelte

@@ -13,8 +13,7 @@
 
 <div class={outerClassName}>
 	<input
-		class={inputClassName}
-		class:dot={!show}
+		class={`${inputClassName} ${show ? '' : 'password'}`}
 		{placeholder}
 		bind:value
 		required={required && !readOnly}
@@ -62,9 +61,3 @@
 		{/if}
 	</button>
 </div>
-
-<style>
-	.dot {
-		-webkit-text-security: disc;
-	}
-</style>