How to set background color in vaadin text area - textarea

I am trying to customize the appearance of text areas by setting a css style as follows in my own theme:
textarea.v-textarea {
font-family: 'Lucida Console', Monaco, monospace;
background-color:black;
color: light green;
}
This works fine when the TextArea does not have the focus (i.e. text is green and background is black). The moment I click in the TextArea, the background switches back to white...what am i missing? Thanks!

you can override other styles by adding !important to the style
textarea.v-textarea {
font-family: 'Lucida Console', Monaco, monospace;
background-color:black !important;
color: light green;
}
I would also search all the css and see if somewhere there is something like this and remove it
textarea.v-textarea::selection {
font-family: 'Lucida Console', Monaco, monospace;
background-color:white;
color: light green;
}

Related

how to reset the effect of bootstrap 5 text-muted

I am using bootstrap 5 "text-muted" to grey out or dim the text. On hover, I would like to undo this effect on the text. I am able to make other effects for e.g. text decorations (underline) etc., on hover but not able to revert this effect. Is there a way to do this?
li a {
color: white;
&:hover {
text-decoration: underline;
}
}
<li class="nav-item mb-2">Home</li>
BS provides the .text-reset class which does what you want.
Since you are compiling from source you can just extend the class:
li a {
color: white;
&:hover {
#extend .text-reset;
text-decoration: underline;
}
}
Or,
If you look at the style rule you can see what declarations are needed:
.text-reset {
--bs-text-opacity: 1;
color: inherit!important;
}
And copy them to your rule:
li a {
color: white;
&:hover {
--bs-text-opacity: 1;
color: inherit!important;
text-decoration: underline;
}
}
You need to revert the color of the link (like the color of the body) when hovering it
.nav-item a:hover {
color: $gray-900 !important; // It is #212529
}
If you will see the default color of the body in the variables.scss file it is $gray-900
$body-color: $gray-900 !default;

I have a dropdown menu and want to show a partial depending on the answer in Rails

I have a menu and I want to link to an apartment booking menu depending on the option chosen. There are three cities and when one city is selected I want to render the partial that contains the booking form.
The dropdown works, but I can't get it to show the correct partial based on selection. The partial contains different booking forms that are widgets coming from an external website. Once the partial is linked properly I can use ajax to make sure the page doesn't refresh when the partial is being loaded.
I'm very new to Rails and can't get this done. Am I on the right track here? Any help would be greatly appreciated!
<select name="locations">
<option value="basingstoke">Basingstoke</option>
<option value="cardiff">Cardiff</option>
<option value="sheffield">Sheffield</option>
<% if option_value_selected?(basingstoke, selected) %>
<%= render 'components/book_basingstoke' %>
<% elsif option_value_selected?(cardiff, selected) %>
<%= render 'components/book_cardiff' %>
<% else option_value_selected?(sheffield, selected) %>
<%= render 'components/book_sheffield' %>
<% end %>
</select>
Ruby on Rails is not a reactive view library like react.js. option_value_selected is evaluated at rendering time from server side. (Is not something you are looking for)
I would recommend you look this link jquery example.
Basically you need to render all three views at server side and hide them using js.
$(function() {
$('#colorselector').change(function() {
$('.colors').hide();
$('#' + $(this).val()).show();
});
});
// [forked from](http://jsfiddle.net/FvMYz/)
// [show-hide-based-on-select-option-jquery)(http://stackoverflow.com/questions/2975521/show-hide-div-based-on-select-option-jquery/2975565#2975565)
/* https://gist.github.com/toddparker/32fc9647ecc56ef2b38a */
/* Some basic page styles */
body {
font: 100%/1.5 AvenirNext-Regular, Corbel, "Lucida Grande", "Trebuchet Ms", sans-serif;
color: #111;
background-color: #fff;
margin: 2em 10%
}
/* Label styles: style as needed */
label {
display: block;
margin: 2em 1em .25em .75em;
font-size: 1.25em;
color: #333;
}
/* Container used for styling the custom select, the buttom class adds the bg gradient, corners, etc. */
.dropdown {
position: relative;
display: block;
margin-top: 0.5em;
padding: 0;
}
/* This is the native select, we're making everything the text invisible so we can see the button styles in the wrapper */
.dropdown select {
width: 100%;
margin: 0;
background: none;
border: 1px solid transparent;
outline: none;
/* Prefixed box-sizing rules necessary for older browsers */
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
/* Remove select styling */
appearance: none;
-webkit-appearance: none;
/* Magic font size number to prevent iOS text zoom */
font-size: 1.25em;
/* General select styles: change as needed */
/* font-weight: bold; */
color: #444;
padding: .6em 1.9em .5em .8em;
line-height: 1.3;
}
.dropdown select,
label {
font-family: AvenirNextCondensed-DemiBold, Corbel, "Lucida Grande", "Trebuchet Ms", sans-serif;
}
/* Custom arrow sits on top of the select - could be an image, SVG, icon font, etc. or the arrow could just baked into the bg image on the select */
.dropdown::after {
content: "";
position: absolute;
width: 9px;
height: 8px;
top: 50%;
right: 1em;
margin-top: -4px;
z-index: 2;
background: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12'%3E%3Cpolygon fill='rgb(102,102,102)' points='8,12 0,0 16,0'/%3E%3C/svg%3E") 0 0 no-repeat;
/* These hacks make the select behind the arrow clickable in some browsers */
pointer-events: none;
}
/* This hides native dropdown button arrow in IE 10/11+ so it will have the custom appearance, IE 9 and earlier get a native select */
#media screen and (-ms-high-contrast: active),
(-ms-high-contrast: none) {
.dropdown select::-ms-expand {
display: none;
}
/* Removes the odd blue bg color behind the text in IE 10/11 and sets the text to match the focus style text */
select:focus::-ms-value {
background: transparent;
color: #222;
}
}
/* Firefox >= 2 -- Older versions of FF (v2 - 6) won't let us hide the native select arrow, so we'll just hide the custom icon and go with native styling */
/* Show only the native arrow */
body:last-child .dropdown::after,
x:-moz-any-link {
display: none;
}
/* reduce padding */
body:last-child .dropdown select,
x:-moz-any-link {
padding-right: .8em;
}
/* Firefox 7+ -- Will let us hide the arrow, but inconsistently (see FF 30 comment below). We've found the simplest way to hide the native styling in FF is to make the select bigger than its container. */
/* The specific FF selector used below successfully overrides the previous rule that turns off the custom icon; other FF hacky selectors we tried, like `*>.dropdown::after`, did not undo the previous rule */
/* Set overflow:hidden on the wrapper to clip the native select's arrow, this clips hte outline too so focus styles are less than ideal in FF */
_::-moz-progress-bar,
body:last-child .dropdown {
overflow: hidden;
}
/* Show only the custom icon */
_::-moz-progress-bar,
body:last-child .dropdown:after {
display: block;
}
_::-moz-progress-bar,
body:last-child .dropdown select {
/* increase padding to make room for menu icon */
padding-right: 1.9em;
/* `window` appearance with these text-indent and text-overflow values will hide the arrow FF up to v30 */
-moz-appearance: window;
text-indent: 0.01px;
text-overflow: "";
/* for FF 30+ on Windows 8, we need to make the select a bit longer to hide the native arrow */
width: 110%;
}
/* At first we tried the following rule to hide the native select arrow in Firefox 30+ in Windows 8, but we'd rather simplify the CSS and widen the select for all versions of FF since this is a recurring issue in that browser */
/* #supports (-moz-appearance:meterbar) and (background-blend-mode:difference,normal) {
.dropdown select { width:110%; }
} */
/* Firefox 7+ focus style - This works around the issue that -moz-appearance: window kills the normal select focus. Using semi-opaque because outline doesn't handle rounded corners */
_::-moz-progress-bar,
body:last-child .dropdown select:focus {
outline: 2px solid rgba(180, 222, 250, .7);
}
/* Opera - Pre-Blink nix the custom arrow, go with a native select button */
x:-o-prefocus,
.dropdown::after {
display: none;
}
/* Hover style */
.dropdown:hover {
border: 1px solid #888;
}
/* Focus style */
select:focus {
outline: none;
box-shadow: 0 0 1px 3px rgba(180, 222, 250, 1);
background-color: transparent;
color: #222;
border: 1px solid #aaa;
}
/* Firefox focus has odd artifacts around the text, this kills that */
select:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 #000;
}
option {
font-weight: normal;
}
/* These are just demo button-y styles, style as you like */
.button {
border: 1px solid #bbb;
border-radius: .3em;
box-shadow: 0 1px 0 1px rgba(0, 0, 0, .04);
background: #f3f3f3;
/* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #e5e5e5 100%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #e5e5e5));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%, #e5e5e5 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%, #e5e5e5 100%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%, #e5e5e5 100%);
/* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%, #e5e5e5 100%);
/* W3C */
}
.output {
margin: 0 auto;
padding: 1em;
}
.colors {
padding: 2em;
color: #fff;
display: none;
}
.red {
background: #c04;
}
.yellow {
color: #000;
background: #f5e000;
}
.blue {
background: #079;
}
footer {
margin: 5em auto 3em;
padding: 2em 2.5%;
text-align: center;
}
a {
color: #c04;
text-decoration: none;
}
a:hover {
color: #903;
text-decoration: underline;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<label class="wrapper" for="states">This label is stacked above the select</label>
<div class="button dropdown">
<select id="colorselector">
<option value="red">Red</option>
<option value="yellow">Yellow</option>
<option value="blue">Blue</option>
</select>
</div>
<div class="output">
<div id="red" class="colors red"> “Good artists copy, great artists steal” Pablo Picasso</div>
<div id="yellow" class="colors yellow"> “Art is the lie that enables us to realize the truth” Pablo Picasso</div>
<div id="blue" class="colors blue"> “If I don't have red, I use blue” Pablo Picasso</div>
</div>

Trying to remove the underline from a visited link in phpBB

I don't know if it's possible, or advisable even if it is. I'm using phpBB 3.2.3 I've replaced every instance of the word underline in styles/prosilver/theme/links.css with the word none. After doing that, I then changed the following line of code,
.postlink {
text-decoration: none;
border-bottom: 1px solid transparent;
padding-bottom: 0;
}
to
.postlink {
text-decoration: none;
border-bottom: 0px solid transparent;
padding-bottom: 0;
}
And I changed the following code from styles/prosilver/theme/colours.css
.postlink {
border-bottom-color: #368AD2;
color: #368AD2;
}
.postlink:visited {
border-bottom-color: #5D8FBD;
color: #5D8FBD;
}
to
.postlink {
color: #368AD2;
}
.postlink:visited {
color: #5D8FBD;
}
I then purged the forum's cache and ctrl+f5'd my browser. Links now appear without an underline but only until I click, after which an underline appears. Is there any way for me to stop that underline from appearing? Or should I even try?
I found the answer elsewhere on this site!
I had to add the following line of code to the bottom of styles/prosilver/theme/links.css
a, a:hover, a:active, a:visited, a:focus {
text-decoration:none;
}
That did the trick! Now I'm not getting any underline at all!

Stop my link colors from changing colors?

I have Dreamweaver CS6. How do I keep my link colors from changing colors? No choice for none. All I'm given is default which is blue and other color choices. I have it set to hover red, works fine. Any suggestions?
So far I have:
a:hover {
text-decoration: none;
color: #F00
a:link {
text-decoration: none;
color: none;

How to change the font, font size, and font color in JQ Grid?

I want change all of fonts of the grid to Arial. Change the header font-weight bold and make the header color blue. Size of all fonts will be 12px.
The exact changes could depend on version of jqGrid and the fork which you use. Ch make the changes which you asked you should use CSS like
.ui-jqgrid {
font-family: Arial;
}
.ui-jqgrid > .ui-jqgrid-view {
font-size: 12px;
}
.ui-jqgrid .ui-jqgrid-hdiv .ui-jqgrid-labels .ui-th-column {
color: blue;
}
If you use filterToolbar then you should need to add
.ui-jqgrid > .ui-jqgrid-view input,
.ui-jqgrid > .ui-jqgrid-view select,
.ui-jqgrid > .ui-jqgrid-view textarea,
.ui-jqgrid > .ui-jqgrid-view button {
font-size: 12px;
}
additionally. After changing the font size you could want to change some padding values used in the grid.
The demo uses free jqGrid 4.9 and it set red color instead of blue to display the results more clear on jQuery UI Theme which I use.
table{
font-family:'Arial', Helvetica, sans-serif;
font-size:12px;
}
th{
color:blue;
font-weight:bold;
}
You can change the style of a JQ grid like any other html element.

Resources