Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add theming for find/search panel Search panel #1174

Merged
merged 2 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions src/components/TheEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,52 @@ export default class TheEditor extends Mixins(BaseMixin) {
}
}
</script>
<style lang="scss" scoped>
::v-deep .ͼ1 .cm-panel.cm-search *:focus:not(.focus-visible) {
outline: none;
}

::v-deep .ͼ1 .cm-panel.cm-search input[type='checkbox'] {
width: 2.2em;
height: 2.2em;
color: dodgerblue;
vertical-align: middle;
-webkit-appearance: none;
border: 10px;
outline: 0;
flex-grow: 0;
border-radius: 4px;
background: var(--v-toolbar-base);
transition: background 300ms;
cursor: pointer;
margin-right: 0.5em;
}

/* Pseudo element for check styling */

::v-deep .ͼ1 .cm-panel.cm-search input[type='checkbox']::before {
content: '';
color: transparent;
display: block;
width: inherit;
height: inherit;
border-radius: inherit;
border: 2px;
background-color: transparent;
background-size: contain;
box-shadow: inset 0 0 0 1px #ccd3d8;
font-size: 16px;
}

/* Checked */

::v-deep .ͼ1 .cm-panel.cm-search input[type='checkbox']:checked {
background-color: var(--color-primary);
}

::v-deep .ͼ1 .cm-panel.cm-search input[type='checkbox']:checked::before {
box-shadow: none;
background-color: var(--color-primary);
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cpath d='M15.88 8.29L10 14.17l-1.88-1.88a.996.996 0 1 0-1.41 1.41l2.59 2.59c.39.39 1.02.39 1.41 0L17.3 9.7a.996.996 0 0 0 0-1.41c-.39-.39-1.03-.39-1.42 0z' fill='%23fffff'/%3E %3C/svg%3E");
}
</style>
71 changes: 70 additions & 1 deletion src/plugins/codemirrorTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const mainsailEditor = EditorView.theme(
color: '#d4d4d4',
backgroundColor: ui.background,
},

'.cm-activeLine.cm-line': {
caretColor: '#d4d4d4 !important',
},
Expand All @@ -37,6 +36,76 @@ const mainsailEditor = EditorView.theme(
'.cm-selectionMatch': {
backgroundColor: '#add6ff26',
},

'.cm-button': {
'font-family': 'Roboto,sans-serif',
'font-weight': '500',
'font-size': '.675rem',
'letter-spacing': '0.0892857143em',
'vertical-align': 'middle',
padding: '0.3em 1em',
'border-radius': '4px',
'border-width': '0',
color: 'var(--color-primary)',
'background-color': 'var(--v-secondary-darken2)',
'background-image': 'none!important',
'text-transform': 'uppercase',
'text-indent': '0.0892857143em',
'text-aling': 'left',
},

'.cm-textfield:focus': {
'border-color': 'var(--color-primary)!important',
},

'.cm-textfield:focus-visible': {
'border-color': 'var(--color-primary)!important',
},

'.cm-textfield::placeholder': {
'text-transform': 'uppercase',
},
'.cm-panel.cm-search label': {
'font-weight': '500',
'font-family': 'Roboto,sans-serif',
'letter-spacing': '0.0892857143em',
'text-transform': 'uppercase',
'font-size': '12px',
'white-space': 'pre',
color: 'var(--v-primary-base)',
},

'.cm-panel.cm-search [name=close]': {
'font-family': 'Roboto,sans-serif',
'text-transform': 'uppercase',
'font-size': '200%',
'white-space': 'pre',
color: 'var(--color-primary)',
'padding-right': '5px',
'padding-top': '5px',
},

'.cm-button:hover': {
'background-color': 'var(--v-secondary-lighten1)',
'background-image': 'none!important',
'transition-duration': '0.5s',
'transition-timing-function': 'cubic-bezier(1.2,0,.2,1)',
},

'.cm-textfield': {
'font-family': 'Roboto,sans-serif',
'vertical-align': 'middle',
'font-size': '.675rem',
border: '1px solid silver',
backgroundColor: ui.background,
padding: '.3em .1em',
'padding-left': '0.6em',
'border-radius': '0.2em',
},

'.cm-panels': {
'background-color': 'var(--v-toolbar-base)',
},
},
{ dark: true }
)
Expand Down