How to Validate Vendor Prefixes in CSS Like -Webkit- and -Moz-

W3C CSS Validator not detecting correct syntax like WebStorm

So this is a usual behaviour of Webstorm in terms of SVG properties.

how to validate IE 7/8 CSS hacks?

I don't think this is possible. If a non-standard CSS property is present in the style sheet, it won't validate. Nothing one can do to change that.

I think you'll have to choose either valid CSS, or using multiple style sheets.

Is CSS for SVG standard CSS?

Is CSS for SVG “standard” CSS?

No, it is not. It makes use of the CSS language, but it is not in the CSS property specification. It's only part of the SVG specification. It's quite similar to using non-standard vendor extensions, in that while prefixes are defined in the CSS grammar, prefixed properties don't actually validate as CSS solely because they're non-standard.

You're supposed to choose the SVG validation profile when validating your code, but it doesn't appear to work; it spits just as many errors as validating according to the CSS spec would. In that case, then it's probably a validator bug.

How To Adjust A Value In CSS from JavaScript?

You can use the style property to access the styles of the selected element (there's multiple other ways check: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style for more information). Also you can't chain selectors with document.getElementById, you can definitely do that with jQuery though.

var b = document.getElementsByClassName("pic-hover");
b[0].style.left = "800px";

How can I change CSS Class of a textbox on failed Validation and then again change it back on successful validation?

You should just need to add additional conditionals to check for the inverse condition. Also I would create a second class specifically for the invalid version.

<script type="text/javascript">
function BtnClick() {
var val = Page_ClientValidate();

if (!val) {
for (i = 0; i < Page_Validators.length; i++) {
if (!Page_Validators[i].isvalid) {
if (!($("#" + Page_Validators[i].controltovalidate).hasClass("form-invalid")))
$("#" + Page_Validators[i].controltovalidate).toggleClass("form-control form-invalid");
}
else {
if (!($("#" + Page_Validators[i].controltovalidate).hasClass("form-control")))
$("#" + Page_Validators[i].controltovalidate).toggleClass("form-control form-invalid");
}
}
}
return val;
}
</script>

Where form-control is your normal class and form-invalid is you class that adds the red border.

See here removeClass() if it exists and here jquery change class name if you want to change the method at all.

postcss autoprefixer ignoring grid properties with gulp

This feature is disabled by default. You need to enable it in the options given to Autoprefixer with grid: true

Documentation of Autoprefixer

Autoprefixer has 4 features, which can be enabled or disabled by options:

  • supports: false will disable @supports parameters prefixing.
  • flexbox: false will disable flexbox properties prefixing. Or flexbox: "no-2009" will add prefixes only for final and IE versions of specification.
  • remove: false will disable cleaning outdated prefixes.
  • grid: true will enable Grid Layout prefixes for IE.

The decision was made after a vote on Twitter (Issue #817) and the reason behind that is that the old Grid specification implemented in IE10-11 and Edge 12-15 is way too different from the modern one implemented in Chr, Fx, Saf (?) and incoming Edge 16.

You'll need more manual work to achieve an equivalent result on IE10-Edge 15, either a fallback or restraining from using unsupported properties (grid-area, etc) and values (repeat() I think, etc): in both cases it can't be automatically done by Autoprefixer so nope, disabled by default.

EDIT:
Going farther than your question and answering "What can I do with browsers supporting the old first Grid Layout spec introduced with IE10?":

  • useful table from Rachel Andrew on "IE 10-Edge 15" vs "modern browsers and Edge 16+" grid properties if you want to do it by hand or verify if Autoprefixer is doing it right.
  • if you want to separate CSS for those 2 categories of browsers, you can use this gem from Building Production-Ready CSS Grid Layouts Today article in SmashingMag by Morten Rand-Hendriksen:

    @supports (grid-area: auto) { /* */ }

but not @supports (display: grid) {} which won't work alas (see article).

Writing CSS rules to different browsers, how?

Two things. First, make sure you include a DOCTYPE. If you don't, browsers will default to quirks mode, and their interpretation of styles will be different. This way, you can minimize the different CSS interpretations of your page.

Second, I'll point out that IE (the big offender, in my experience) supports conditional comments, so you can include styles for specific IE versions like this:

<!--[if lt IE 8]>
<link rel="stylesheet" href="iehacks.css" type="text/css" />
<![endif]-->


Related Topics



Leave a reply



Submit