Styling ASP.NET MVC validation errors? - asp.net-mvc-3

Can ASP.NET MVC's validation errors be styled? Where?
I tried editing .input-validation-error class in Site.css but that didn't have any effect.
pom

If you style up .field-validation-error then this will change the validation error text messages.
.field-validation-error{ color: red; font-weight: bold; }
If you style up .input-validation-error then this will change the input style when there is a validation error.
.input-validation-error{ background: pink; border: 1px solid red; }

It sounds like what you are doing is correct, but the css gets cached which means you won't necessarilly see the changes you make.
Once you have edited the css file, press Ctrl + F5 from your browser to reload css.

Related

Correct use of Sass parent selector?

I'm trying to make all links on my page have a custom underline similar to this.
Here's what I have so far of a menu that's going to use this feature:
CodePen
The underline, instead of appearing under each link, appears under the "toolbox" div (the link objects' grandparent).
I've tried just making the first CodePen but with the features SCSS allows you (& and nested rules), but I seem to be missing something and won't even show the underline. I'm guessing it has something to do with my use of the parent selector.
How do I make my current code work correctly? If the issue is with my use of parent selectors in general, what is the correct selector to use in this case?
(Stack Overflow is making me put this)
You are using position: absolute in ::after therefore the underline will have absolute position not related to the <a>. Just add position relative to <a> thus inclosing the absolute ::after content to it.
.navbar {
background-color: #191919cc;
padding: 10px;
border-radius: 10px;
a {
position: relative; // here
margin: 0 10px;
}
}
codepen link: https://codepen.io/ashwin-chandran/pen/BaZjQLz

How to use react-multi-carousel with typescript

I need a component exactly like below picture.
image code is here but i need that codes for typescript.
and also copy codes not working!
any body can help with an example in https://codesandbox.io/.
thanks a lot
Recently I used react-multi-carousel with typescript.
Maybe that carousel's parent style is like this.
display: flex;
Carousel doesn't work with that style so you should change the parent style.
It's not a problem caused by Typescript
display: block or add this style.
min-width: 400px; max-width: 400px;
it works for me.

How to change Bootstrap 4's border-bottom-width via SASS?

I'm just getting into both Laravel and SASS and I took the opportunity to rewrite my old html template into something re-usable and SASS the CSS rules.
In my HTML template, I had the borders such as follows:
input[type="text"]{
border-style:solid;
border-color:red;
border-width:1px 1px 4px 1px;
}
<input type="text" />
So I would have a border-bottom of 4px and rest would be 1px, in the same style and same color. I wanted to override Bootstrap 4's $border-width property so I went ahead and changed it to 1px 1px 4px 1px, and boom. It didn't work.
After inspecting the SASS files, I've noticed that they're not used the way I thought they'd be, but instead they look something like:
border: $border-width solid $border-color
So that got me thinking, there are probably several ways to resolve this, one way I went ahead and done so far is:
$border-widths:1px 1px 4px 1px;
input[type="text"].form-control{
border-width:$border-widths!important;
}
So I'm leaving the default $border-width variable as is, and instead creating my own variable and then selecting the input and overriding the border-width property only. Which looks, not right because:
This is my _variables.scss override file and I kind of want it to stay that way.
I could do this with just CSS override the same way, but then it'd defeat the whole purpose.
I have to explicitly use !important otherwise I can't override Bootstrap 4's rules.
So, there must be another way, I guess. But what exactly?
I ended up simply keeping the !important for overriding and just made myself another scss file, and written the rules there:
_variables.scss
$border-widths: 1px 1px 4px 1px;
_custom.scss
.border-thick-bottom{ border-width:$border-widths!important; border-style:solid; }

using css modules with scss

I'm using css modules. Each css module is a scss file and looks something like the following:
.componentWrapper {
border: solid cadetblue;
border-radius: 40px;
padding: 10px;
width: 95%;
&.componentTitle {
font-size: 18px;
width: 15%;
background-color: white;
margin-top: -25px;
}
}
Is it considered an anti-pattern to use & inside css modules?
Well no. Just keep in mind that this forces you to have the html in an appropriate structure to make that work. So in case the styles are only used in this module and not needed anywhere else, that is absolutely fine. But if you need those Styles somewhere else, in another context which does not have the appropriate html structure, another approach, f.i. by using classes, would be better. Then the #extend directive can come in handy.
No, sass-loader will run first and spit out plain CSS
CSS modules takes the CSS and scopes it.

Slick grid - Slick.Editors.LongText working as Slick.Editors.Text & remains non-editable due to wrong version of jquery

I am working with editable slick grid and copied the code from here:
Code
Demo Example
I have included required JS files and the CSS. But when the grid loads, the LongText fields acts as Text field and remains uneditable.
See below image for more information.
I do not see any JS error on the console. What could be the reason for this behavior??
Upon further investigation, my friend found out that the pop-up which shows the textarea, does comes up but the its style is set as disply:none . This style is applied to the div which actually shows the pop-up. If we change the style for this div to diplay:block I can see the pop-up.
element.style {
z-index: 10000;
position: absolute;
background-color: white;
padding: 5px;
border: 3px solid gray;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
top: 489px;
left: 505px;
display: none;
background-position: initial initial;
background-repeat: initial initial;
}
Update: I just came to know the issue is due to wrong version of jquery being used. Please check this link for working example:
problem: On index.html page, if I change the jquery version from 1.7 to 1.9, the pop-up on description field does not appear. I am using following CDN for jquery. I cannot switch back to lower version of Jquery as I am using version 1.9 for other purpose in my project.
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
To answer my own question, I am now using latest version of slick grid (2.2.2 at the time of publishing this answer) which supports jquery 1.9 as well. I must give credit to #BelowTheRadar for his suggestion.

Resources