Skip to content

Instantly share code, notes, and snippets.

View Kobe's full-sized avatar

Kobe Kobe

View GitHub Profile
@Kobe
Kobe / wp_functions.php
Last active January 25, 2018 16:15
deactivate anything in wp_head
<?php
// add theme support for
add_theme_support('html5');
add_theme_support('menus');
add_theme_support('post-formats', array(
'aside',
'image',
'link',
'status'
));
@Kobe
Kobe / _mixin_bem.scss
Last active June 23, 2018 11:43 — forked from mmintel/gist:045ffce76b00b327bfc0
BEM mixins in Sass 3.4
$elementSeparator: '__';
$modifierSeparator: '--';
@function containsModifier($selector) {
$selector: selectorToString($selector);
@if str-index($selector, $modifierSeparator) {
@return true;
} @else {
@return false;
}
@Kobe
Kobe / _mixin-bem.sass
Last active June 23, 2018 11:44 — forked from molily/bem.sass
BEM helper mixins for Sass
// Mixins for generating Block Element Modifier (BEM) class names.
// See https://css-tricks.com/snippets/sass/bem-mixins/
// They can be nested to produce meaningful classes.
// To create a descendant selector like `.block--modifier .block__element`
// the block needs to be repeated. For example:
// +block(some-block)
//
// +element(some-element)
// color: red
//

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
<FilesMatch "\.(txt|log|xml|css|js|gz)$">
Header set X-Robots-Tag "noindex"
</FilesMatch>
location ~* \.(txt|log|xml|css|js|gz)$ {
add_header X-Robots-Tag noindex;
}
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
RewriteRule ^(wp-content/uploads.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
</IfModule>
<IfModule mod_headers.c>
Header append Vary Accept env=REDIRECT_accept
</IfModule>
@Kobe
Kobe / wp_style.css
Last active February 14, 2016 16:58
Wordpress stylesheet head
/*
Theme Name: foo.de
Theme URI: http://www.foo.de
Author: Ingo Stoecker
Author URI: http://www.kobe8.de
*/