How to disable highlight active line in codemirror when editor is not selected? - codemirror

I only want to have active line on when the current code editor is selected. How would I set this on editor initialisation?

Use .CodeMirror-focused class, so that the line is only styled when the cursor is focused within the editor. Then make the normal .CodeMirror-activeline-background transparent so that when the cursor is not focused within the editor, it will not be styled.
.CodeMirror-activeline-background {
background: transparent !important;
}
.CodeMirror-focused .CodeMirror-activeline-background {
background: rgba(100, 100, 100, 0.1) !important;
}

Related

VSCode: Altering pinned tabs - either make the font smaller or increase tab width

I am working with Custom CSS Loader and it's all setup.
I can alter CSS for VSCode and make changes. But the only thing I cannot change for some reason is the text within the tab.
I can alter the icon size when I just font-size for tab. But it has no effect on the text size.
And I have try increasing the width of the tab but there is no go.
I can only guess what .tab-container and .tab does.
Here is what I want to alter:
Here's the CSS code I stole from someone's suggestion within VSCode's Issues:
:root {
--size-reduction: 12px;
}
.monaco-shell {
font-family: "JetBrains Mono", "Monoco", monospace;
}
.tabs-container .tab,
.tabs-container .monaco-icon-label,
.tabs-container .monaco-icon-label::before,
.tabs-and-actions-container .editor-actions {
height: unset !important;
}
.monaco-workbench .tabs-container .tab * {
font-size: 0.5em;
width: 100px;
}
.editor-instance > .monaco-editor,
.editor-instance > .monaco-editor .overflow-guard,
.editor-instance > .monaco-editor .monaco-scrollable-element {
height: 100% !important;
}
.editor-instance,
.editor-instance > .settings-editor .settings-toc-wrapper,
.editor-instance > .settings-editor .settings-editor-tree {
height: calc(100% + var(--size-reduction)) !important;
}
.editor-instance > .settings-editor {
height: calc(100% - var(--size-reduction)) !important;
}
Can someone please break down the each of the elements (.tab, .tab-container, etc.) or point me to a source that breaks it all down?
Also, if I adjust the font-size within tab, why isn't the tab's fonts shrinking?
My Pinned Tab Sizing is set to "Shrink". I have tried changing it from Compact and Norman with no difference in Font Sizing.
My normal font is "Jetbrains Mono" for the editor.
Acknowledging that this answer does not answer my original inquiry of "altering shrink pinned tabs either with width or font size."
But without using CSS-Custom-Loader and fiddling with the viscose's css, I found a more elegant solution using the UI settings.
The three settings to pay attention to:
Pinned Tab Sizing: Normal
Workbench > Editor: Show Tabs checked
Workbench > Editor: Tab Sizing shrink
Now I will pin 8 to 10 tabs at a time. So this will fit nice and neat within a workspace.
If I had 30 pinned tabs, I don't know if it would show enough to make a difference.

How do I change the color and width of material drawer component in angular-dart in css?

My first question ever - so apologies if I am not specific enough.
How do I change the color and width of material drawer component in angular-dart in css? I have tried it several ways in the CSS, including as below:
::ng-deep material-drawer {
color: #9437FF;
width: 200px;
}
.material-drawer {
color: #9437FF;
width: 200px;
}
FYI, the following worked with the material-header, which is inside a header tag:
::ng-deep header.material-header.material-header {
background-color: white;
color: #9437FF;
}
My material-drawer is not in a div or anything, just directly an HTML element on its own.
Any pointers are appreciated!
Setting the width of the drawer is a bit complicated. It involves setting a good amount of values as such it is best to use the mixin. You can see an example here
As for the color that is a little bit harder. What color are you trying to change? The background color?
For the background color you can set the background-color on the drawer. The problem is going to be that the content itself is going to override that color. In this case the material-list has it's own white color associated with it. Removing that color you could have problems with the divider colors.

Rotate Icon on 90 Degree SAPUI5 and background color

I want to show thumb-left icon on button in sapui5. thumb-left is not available. So can i choose thumb-down or thumb-up and rotate it on 90 Degree ?
How I can do it.
2ndly How to set the buttons color Red, Green ,Yellow. I set button type to Accept, Reject but it just make border of buton green ,red,
<Button id="btnNegative" type="Reject" icon="sap-icon://thumb-down" text="Negative" press=".onSentimentFeedBackButtonclick"></Button>
<Button id="btnNeutral" type="Accept" icon="sap-icon://thumb-up" text="Neutral" press=".onSentimentFeedBackButtonclick"></Button>
Here is a simple example
In your XML add a custom class to your button
<Button id="btnNeutral" class="myNeutralThumb" icon="sap-icon://thumb-up" text="Neutral" press=".onSentimentFeedBackButtonclick" />
Then in your style.css (or however your CSS file is named) add the following:
button.myNeutralThumb .sapMBtnInner {
border-color: #ff0 !important;
}
button.myNeutralThumb .sapMBtnIcon {
transform: rotate(90deg);
color: #ff0 !important;
}
The first style changes the color of the button's border. Probably that should be the same color as the icon.
The second style rotates your thumb icon and changes its color.
If you also want to change the background-color of your button, put something like background-color: #fff; in the second style rule.
Edit: Replaced complicated and long and non-future-proof CSS style rule with short CSS rule + !important

SuggestBox color the items

I want to give the items in my suggestbox a custom background color.
Is this possible?
like
item.getElement().getStyle().setBackgroundColor("red");
just add this to your css file to change the background color of an item/selected-item
.gwt-SuggestBoxPopup .item {
background: red !important;
}
.gwt-SuggestBoxPopup .item-selected {
background: black !important;
}
look here for detailed information

How to style GtkNotebook stepper arrows?

I'm trying to style a GtkNotebook using a GtkCssProvider. I can control most things using a GtkNotebook or GtkNotebook tab selector, but I can't figure out how to style the scroll arrows on the side:
If I apply a style that changes every element, e.g.:
* {
color: #f00;
}
it changes the arrows (and everything else), so it appears they do support theming:
What is the actual selector that matches those arrows, so I can apply a style to just them?
Looking at the source code, arrows in GtkNotebook are not full fledged widgets; they are just rendered with gtk_render_arrow().
The code of gtk_render_arrow shows the CSS class arrow is applied before the rendering. This means you can customize the position within the notebook class and the rendering in the arrow subclass, e.g.:
.notebook {
-GtkNotebook-initial-gap: 20;
-GtkNotebook-arrow-spacing: 20;
}
.notebook.arrow {
color: black;
}
.notebook.arrow:prelight {
color: white
}
.notebook.arrow:insensitive {
color: gray
}
Different theme engines can provide additional customizations.