From ec151a405ad06ba7a935b77ef11c866a04ce65d3 Mon Sep 17 00:00:00 2001 From: Justineo Date: Wed, 23 Feb 2022 20:19:58 +0800 Subject: [PATCH] feat: bring back simple code toggle --- components/OneDemo.vue | 45 +++++++++++++++++++++++--------------- components/OneEditLink.vue | 8 +++++-- plugins/l10n.js | 8 +++++-- 3 files changed, 39 insertions(+), 22 deletions(-) diff --git a/components/OneDemo.vue b/components/OneDemo.vue index 086c616..2efef8a 100644 --- a/components/OneDemo.vue +++ b/components/OneDemo.vue @@ -35,20 +35,8 @@ > - - - @@ -57,9 +45,18 @@ :name="codeExpanded ? 'one-demo-code-off' : 'one-demo-code'" /> + + Live + @@ -240,7 +237,7 @@ Icon.register({ .codeExpanded & border-radius 0 - .veui-button + .veui-button:not(.toggle-editor) font-size 18px .veui-button + .veui-button @@ -277,13 +274,25 @@ Icon.register({ opacity 0 transform scale(0.99) translateY(3px) -.toggle-source - display none +.toggle-editor + height 20px + padding 0 3px + font-weight 600 + + &::after + content none !important + + & + &:hover + &[data-focus-visible-added] + &:active + border 1.5px solid currentColor !important + + &[data-focus-visible-added] + border-color #0052cc !important + box-shadow 0 0 0 2px rgba(0, 102, 255, 0.2) !important @media (max-width 480px) - .toggle-source - display inline-flex - .toggle-editor display none diff --git a/components/OneEditLink.vue b/components/OneEditLink.vue index d0cdf0f..06dd862 100644 --- a/components/OneEditLink.vue +++ b/components/OneEditLink.vue @@ -13,7 +13,7 @@ rel="noopener" > - {{ t('editOnGitHub') }} + {{ t('editOnGitHub', { item: t(type) }) }} {{ t('edit') }}