CSS3 Structural Pseudo-class Expressions Explained

Publié à 15:49

Bricss: Easily checking in JavaScript if a CSS media query has been executed

bricss:

For quite a while I have been looking for a way to “mirror” my CSS media queries in JavaScript, but without duplicating the actual queries. Of course, you can use matchMedia to evaluate a media query in JavaScript, but then you have to maintain your breakpoints in two places – not ideal.

Paul…

Reblogué depuis Bricss Publié à 16:16 34 notes

Remove style attributes with a REGEX when you paste HTML in CKEditor

Using CKEditor and jQuery

$('#htmleditor').ckeditor(options).bind('instanceReady.ckeditor', function() {
  CKEDITOR.instances['htmleditor'].on('paste', function(e) {
    e.data.html = e.data.html.replace(/\s*style="[^"]*"/g, '');
  });
});

Tags: regexckeditorjquery Publié à 14:18

JavaScript object structure: speed matters

For example, rather than doing the following:

var universe = {
  answer: 42
};
// do something else
universe.panic = false;

it’s recommended to implement it this way:

var universe = {
  answer: 42,
  panic: true
};
// do something else
universe.panic = false;

Publié à 19:19

Cursors!

All CSS cursors together on one page.

Publié à 19:00