Skip to content

Instantly share code, notes, and snippets.

View MurakamiShinyu's full-sized avatar

Shinyu Murakami MurakamiShinyu

View GitHub Profile
@MurakamiShinyu
MurakamiShinyu / dabblet.css
Created March 13, 2015 10:51
Flex centering
/**
* Flex centering
*/
body {
display: flex;
border: outset blue;
margin: 0;
text-align: center;
height: 100vh;
box-sizing: border-box;
@MurakamiShinyu
MurakamiShinyu / dabblet.css
Last active February 3, 2019 01:26
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
<!DOCTYPE html>
<html>
<head>
<title>Test: Page Header + Page Bottom Float</title>
<style>
.pagebottomfloat {
float: bottom;
float-reference: page;
}
@page {
<!DOCTYPE html>
<html>
<head>
<title>Test: Page Header + Footnote</title>
<style>
.footnote {
float: footnote;
}
@page {
@top-center {
@MurakamiShinyu
MurakamiShinyu / cssLogical.pl
Created November 26, 2019 14:27
Convert CSS non-logical properties to logical properties
#!/usr/bin/perl
while (<>) {
s/(?<![^;{\s])(margin|padding|border)-top:/$1-block-start:/g;
s/(?<![^;{\s])(margin|padding|border)-right:/$1-inline-end:/g;
s/(?<![^;{\s])(margin|padding|border)-bottom:/$1-block-end:/g;
s/(?<![^;{\s])(margin|padding|border)-left:/$1-inline-start:/g;
s/(?<![^;{\s])border-top-(color|style|width):/border-block-start-$1:/g;
s/(?<![^;{\s])border-right-(color|style|width):/border-inline-end-$1:/g;
s/(?<![^;{\s])border-bottom-(color|style|width):/border-block-end-$1:/g;
s/(?<![^;{\s])border-left-(color|style|width):/border-inline-start-$1:/g;
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Test: Table with variable number of cells in rows</title>
<style>
table,
td {
border: 1px solid;