From 963401f279a82cf183f54659c35abaa40304cc8e Mon Sep 17 00:00:00 2001 From: Pavlo Myroniuk Date: Sat, 3 Feb 2024 22:57:27 +0200 Subject: [PATCH] feat(crypto-helper): asn1: styling improvements: bigger gap between tree and hex views, fix wide values rendering by adding tree dots in the end of them (thanks to 'text-overflow: ellipsis') --- public/styles/asn1/node.scss | 3 ++- public/styles/asn1/page.scss | 2 +- src/asn1/scheme/strings.rs | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/public/styles/asn1/node.scss b/public/styles/asn1/node.scss index 8b0b4c54..dfc2b38d 100644 --- a/public/styles/asn1/node.scss +++ b/public/styles/asn1/node.scss @@ -4,7 +4,7 @@ gap: 0.2em; align-items: center; cursor: crosshair; - width: 100%; + width: calc(100% - 0.5em); } .asn1-constructor-header { @@ -37,6 +37,7 @@ background-color: #aab7ce; font-size: 0.7em; overflow: hidden; + text-overflow: ellipsis; } .asn-bool-true { diff --git a/public/styles/asn1/page.scss b/public/styles/asn1/page.scss index 564e3301..3e044724 100644 --- a/public/styles/asn1/page.scss +++ b/public/styles/asn1/page.scss @@ -8,6 +8,6 @@ .asn1-viewers { display: grid; grid-template-columns: 70% auto; - gap: 0.1em; + gap: 0.7em; width: 100%; } \ No newline at end of file diff --git a/src/asn1/scheme/strings.rs b/src/asn1/scheme/strings.rs index f9cdd169..51fcea8b 100644 --- a/src/asn1/scheme/strings.rs +++ b/src/asn1/scheme/strings.rs @@ -26,7 +26,7 @@ pub fn octet_string(props: &OctetStringNodeProps) -> Html { match props.node.inner() { Some(asn1) => html! { -
+
{format!("({} bytes)", octets.len())} @@ -77,7 +77,7 @@ pub fn bit_string(props: &BitStringNodeProps) -> Html { match props.node.inner() { Some(asn1) => html! { -
+
{format!("({} bits)", bits_amount)}