Skip to content

Instantly share code, notes, and snippets.

View AstronautSion's full-sized avatar

Sean Um AstronautSion

View GitHub Profile
@AstronautSion
AstronautSion / dom.fn.js
Created July 10, 2018 15:01 — forked from yamoo9/dom.fn.js
DOM 스크립트 라이브러리 - 함수형 프로그래밍
(function(global, document) {
'use strict';
var namespace = 'y9';
function el(selector, context) {
return (context || document).querySelector(selector);
}
function els(selector, context) {
return (context || document).querySelectorAll(selector);
@AstronautSion
AstronautSion / helper.js
Created May 5, 2018 14:41 — forked from yamoo9/helper.js
helper.js
(function(global, document){
'use strict';
/* -----------------------------------------------------
* DOM 선택 헬퍼 함수 */
function els(selector, context) {
if (typeof selector !== 'string' || selector.trim().length === 0) { return null; }
context = !context ? document : context.nodeType === 1 ? context : el(String(context));
return context.querySelectorAll(selector);
/* ----------------------------------------------------------------------------------------------------
Super Form Reset
A couple of things to watch out for:
- IE8: If a text input doesn't have padding on all sides or none the text won't be centered.
- The default border sizes on text inputs in all UAs seem to be slightly different. You're better off using custom borders.
- You NEED to set the font-size and family on all form elements
- Search inputs need to have their appearance reset and the box-sizing set to content-box to match other UAs