Skip to content

Commit

Permalink
[#2112] Move Segment CSS into c-segment.vue (#2113)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sopa301 authored Feb 19, 2024
1 parent b103e28 commit fdb1892
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 74 deletions.
73 changes: 0 additions & 73 deletions frontend/src/components/c-authorship-file.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
}
</style>
74 changes: 73 additions & 1 deletion frontend/src/components/c-segment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,78 @@ export default defineComponent({
});
</script>

<style lang="css">
<style lang="scss" scoped>
@import '../styles/hightlight-js-style.css';
.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;
}
}
}
}
</style>

0 comments on commit fdb1892

Please sign in to comment.