Skip to content

Commit

Permalink
feat(suite): Enhance HiddenPlaceholder using special font
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemonexe committed Aug 23, 2024
1 parent a057422 commit 7f904d7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Binary file not shown.
11 changes: 11 additions & 0 deletions packages/suite-data/files/fonts/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,14 @@
font-weight: 500;
font-style: normal;
}

/*
Special font that has all numbers replaced with the same placeholder symbol.
DO NOT USE except when you need to redact sensitive information!
*/
@font-face {
font-family: 'TT Satoshi redacted numbers';
src: url('./TTSatoshi/TTSatoshi-redacted-numbers.otf') format('opentype');
font-weight: 500;
font-style: normal;
}
15 changes: 15 additions & 0 deletions packages/suite/src/components/suite/HiddenPlaceholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,23 @@ const Wrapper = styled.span<WrapperProps>`
transition: all 0.1s ease;
filter: blur(${$intensity}px);
/*
It is needed to target both this element, and all of its children.
Otherwise the * global selector, which declares normal font, overrides font for HiddenPlaceholder's children (even when !important is used).
*/
font-family: 'TT Satoshi redacted numbers', sans-serif;
& * {
font-family: 'TT Satoshi redacted numbers', sans-serif;
}
&:hover {
filter: none;
font-family: unset;
& * {
font-family: unset;
}
}
`}
`;
Expand Down

0 comments on commit 7f904d7

Please sign in to comment.