This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let scrollbarWidth; | |
export default function measureScrollBarWidth(opts = {}) { | |
const { force = false } = opts; | |
if (force || typeof scrollbarWidth === "undefined") { | |
const div = document.createElement("div"); | |
div.style.position = "absolute"; | |
div.style.overflowY = "scroll"; | |
div.style.width = div.style.height = "100px"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.responsiveTable = (function() { | |
var $window = $(window); | |
return function() { | |
var $el = this; | |
var $table = this.find('>table'); | |
var onResize = function() { | |
var width = $table.outerWidth(); | |
var height = $table.outerHeight(); | |
var $parent = $el.parent(); | |
var containerWidth = $parent.width(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.smooth-scroll { | |
transition: transform .5s ease-out; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.smooth-scroll { | |
transition: transform 0.5s ease-out !important; | |
} | |
.smooth-scroll-fixed { | |
display: none !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no" id="meta-viewport"> | |
<script> | |
!function() { | |
var viewport = document.getElementById('meta-viewport'); | |
function onResize () { | |
var value = window.outerWidth < 375 ? "width=375" : "width=device-width,initial-scale=1,shrink-to-fit=no"; | |
if (viewport.getAttribute('content') !== value) { | |
viewport.setAttribute('content', value); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@charset "UTF-8"; | |
.Checkbox { | |
@at-root { | |
@function checked-icon($color: #fff) { | |
$color: '' + $color; | |
$color: '%23' + str-slice($color, 2); | |
@return 'data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M9%2016.17L4.83%2012l-1.42%201.41L9%2019%2021%207l-1.41-1.41z%22%20fill%3D%22#{$color}%22%2F%3E%3C%2Fsvg%3E'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@charset "UTF-8"; | |
.Radio { | |
@at-root { | |
& { | |
position: relative; | |
z-index: 0; | |
display: inline-flex; | |
justify-content: flex-start; | |
align-items: baseline; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@charset "UTF-8"; | |
.TextInput { | |
@at-root { | |
& { | |
width: 100%; | |
height: rem(40px); | |
padding: 0 rem(14px); | |
border: 0; | |
color: inherit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@charset "UTF-8"; | |
.Textarea { | |
@at-root { | |
& { | |
position: relative; | |
color: inherit; | |
font-size: rem(16px); | |
line-height: 1.8; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 引数を起点に兄弟要素、親の兄弟要素、さらに親の兄弟要素、…を取得する | |
* @param {Element} baseElement | |
* @return {[Element]} 対象となるHTML要素 | |
*/ | |
export function collectAllSiblings(baseElement) { | |
const targets = [] | |
let current = baseElement | |
while (current && current !== document.body) { | |
const siblings = Array.from(current.parentNode.children) |