Skip to content

Instantly share code, notes, and snippets.

View felipefialho's full-sized avatar
:octocat:
working at @juntossomosmais and @frontendbr 🙃

Felipe Fialho felipefialho

:octocat:
working at @juntossomosmais and @frontendbr 🙃
View GitHub Profile
@felipefialho
felipefialho / border-color-parent-color.md
Created December 5, 2016 15:44
[CSS Trick] Border-color with the same color of parent font dynamically

Border-color with the same color of parent font dynamically

.foo
  border-color currentColor
  color tomato

!important, It works with all elements inside of parent.

@felipefialho
felipefialho / git-delete-local-remote-branch.md
Created November 24, 2016 12:49
[Git Trick] Easier way to delete branch local and remote

Easier way to delete branch local and remote

$ git branch -d [the_branch]
$ git push origin :[the_branch]

👽

@felipefialho
felipefialho / css-fist-not-last.md
Created November 23, 2016 17:55
[CSS Trick] Select on sametime the first element but not if it is the last element

Select on sametime the first element but not if it is the last element

&:first-child:not(:last-child)

👺

@felipefialho
felipefialho / css-capitalize.md
Last active December 19, 2018 19:18
[CSS Trick] Capitalize the first letter only

Capitalize the first letter only

.foo
  text-transform lowercase
  
  &:first-letter 
    text-transform uppercase
@felipefialho
felipefialho / css-empty.md
Last active November 24, 2016 20:42
[CSS Trick] Hide dynamic element that break the layout when it is empty.

Hide dynamic element that break the layout when it is empty.

&:empty
  display none

!important, it can't have space on HTML

✌️

// The molecule
.card
h2
...
p
...
.price
...
<section class="place">
<div class="place__container">
<h1>Lugares vistos recentemente</h1>
<p>Continue de onde parou</p>
<a class="card" href="#">
<div class="card__main">
<img src="" alt="">
<h2>Hospedado por Luciana</h2>
<p>Rio de Janeiro</p>
// ==================================================
// IE Checker
// ==================================================
function isIE(userAgent) {
userAgent = userAgent || navigator.userAgent;
return userAgent.indexOf('MSIE ') > -1 || userAgent.indexOf('Trident/') > -1 || userAgent.indexOf('Edge/') > -1;
}
0 info it worked if it ends with ok
1 verbose cli [ 'c:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Felipe\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install' ]
2 info using npm@3.5.3
3 info using node@v5.11.1
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly install normalizeTree
@felipefialho
felipefialho / zepto.smoothScroll.js
Last active June 22, 2016 00:39 — forked from austinpray/zepto.smoothScroll.js
Zepto.js smooth vertical scrolling method. Implementing this code turns all anchor links with the class "scrollTo" into smooth scrolling anchor links. Rework of the foundation.js library method.
// ==================================================
// Smooth Scroll
// ==================================================
function smoothScroll(el, to, duration) {
'use strict';
if (duration < 0) {
return;