From fdb189287559bdc8a1792608d728aa98267eb404 Mon Sep 17 00:00:00 2001 From: Ryan Poon <96387349+sopa301@users.noreply.github.com> Date: Mon, 19 Feb 2024 14:32:22 +0800 Subject: [PATCH] [#2112] Move Segment CSS into c-segment.vue (#2113) The segment component CSS currently resides in the c-authorship-file component. Moving it to the segment component would make it easier to edit the segment component in the future. Let's move the CSS into c-segment.vue. --- frontend/src/components/c-authorship-file.vue | 73 ------------------ frontend/src/components/c-segment.vue | 74 ++++++++++++++++++- 2 files changed, 73 insertions(+), 74 deletions(-) diff --git a/frontend/src/components/c-authorship-file.vue b/frontend/src/components/c-authorship-file.vue index 6d7bbf781f..96bd83dd53 100644 --- a/frontend/src/components/c-authorship-file.vue +++ b/frontend/src/components/c-authorship-file.vue @@ -347,78 +347,5 @@ export default defineComponent({ padding-left: 4rem; } } - - .segment { - border-left: .25rem solid mui-color('green'); - - .code { - background-color: mui-color('github', 'authored-code-background'); - padding-left: 1rem; - } - - .line-number { - color: mui-color('grey'); - float: left; - // Not allowing user to select text - -webkit-touch-callout: none; - /* iOS Safari */ - -webkit-user-select: none; - /* Safari */ - -khtml-user-select: none; - /* Konqueror HTML */ - -moz-user-select: none; - /* Firefox */ - -ms-user-select: none; - /* Internet Explorer/Edge */ - user-select: none; - /* Non-prefixed version, currently supported by Chrome and Opera */ - width: 2rem; - - // overwrite all hljs colors - [class^='hljs'] { - color: mui-color('grey'); - } - } - - .line-content { - padding-left: 2rem; - word-break: break-word; - } - - &.untouched { - $grey: mui-color('grey', '400'); - border-left: .25rem solid $grey; - height: 20px; - /* height of a single line of code */ - position: relative; - - &.active { - height: auto; - - .code { - background-color: mui-color('white'); - } - } - - .closer { - cursor: pointer; - // custom margin for position of toggle icon - margin: .2rem 0 0 -.45rem; - position: absolute; - - &.bottom { - //custom margin for position of toggle icon at the bottom of segment - margin: -1.05rem 0 0 -.45rem; - } - - .icon { - background-color: mui-color('white'); - color: mui-color('grey'); - width: .75em; - } - } - } - } - } diff --git a/frontend/src/components/c-segment.vue b/frontend/src/components/c-segment.vue index 7e16cc5fd9..8474b5d3db 100644 --- a/frontend/src/components/c-segment.vue +++ b/frontend/src/components/c-segment.vue @@ -69,6 +69,78 @@ export default defineComponent({ }); -