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
var fs = require('fs'); | |
var postcss = require('postcss'); // Load PostCSS | |
var postcss_nested = require('postcss-nested'); // Load the postcss-nested plugin | |
var simple_media_queries = require('postcss-simple-media-queries'); // Load the postcss-simple-media-queries | |
var css = fs.readFileSync('input.css', 'utf8'); // Your stylesheet | |
var output = postcss([simple_media_queries, postcss_nested]) // The order is important because this plugin depends on nesting capabilities | |
.process(css) | |
.css; |
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
var gulp = require('gulp'); | |
var postcss = require('gulp-postcss'); // Load PostCSS | |
var postcss_nested = require('postcss-nested'); // Load the postcss-nested plugin | |
var simple_media_queries = require('postcss-simple-media-queries'); // Load the postcss-simple-media-queries plugin | |
gulp.task('css', function () { | |
var processors = [ // The order is important because this plugin depends on nesting capabilities | |
simple_media_queries, | |
postcss_nested | |
]; |
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
p { | |
margin: 0; | |
@media (mq('medium')) { | |
margin: 25px 0; | |
} | |
} |
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
p { | |
margin: 0; | |
} | |
@media only screen and ( min-width: 42em ) { | |
p { | |
margin: 25px 0; | |
} | |
} |
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
{ | |
'initialize': '1px', | |
'small': '35.5em', // >= 568px @ 16px | |
'medium': '48em', // >= 768px @ 16px | |
'large': '64em', // >= 1024px @ 16px | |
'extra-large': '80em' // >= 1280px @ 16px | |
} |
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
... | |
var processors = [ | |
simple_media_queries({ | |
'mobile': '32em', | |
'tablet': '45em', | |
'desktop': '64em', | |
'extra-large': '80em', | |
'super-large': '96em' | |
}), | |
postcss_nested |
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
import React, { PureComponent } from 'react'; | |
import { Dimensions, Animated, TouchableWithoutFeedback } from 'react-native'; | |
import styled from 'styled-components'; | |
// I use these values because I have two columns of cards with some space and because | |
// I want to keep a vertical ratio. | |
// You can change them for some fixed values or anything else, it depends of your needs | |
const cardWidth = (Dimensions.get('window').width / 2) - 30; | |
const cardHeight = cardWidth * 1.4 |
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
/* Media queries breakpoints */ | |
$break-small: 35.5rem; // >= 568px @ 16px | |
$break-medium: 48rem; // >= 768px @ 16px | |
$break-large: 64rem; // >= 1024px @ 16px | |
$break-extra-large: 80rem; // >= 1280px @ 16px | |
$break-largest: 90rem; // >= 1440px @ 16px | |
/* Media query mixin */ | |
@mixin respond-to( $condition ) { | |
@if $condition == 'initialize' { @media only screen and (min-width: 1px) { @content; } } |
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
:root, | |
[data-theme="light"], | |
[data-theme="dark"], | |
:root:not([data-theme="light"]) { | |
--background-color: #fff; | |
--primary-foreground-color: #4a4a4a; | |
--secondary-foreground-color: #000; | |
--primary-subtle-color: #04aeee; | |
--secondary-subtle-color: #f4f8fd; | |
--titles-color: #333; |
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
<style> | |
[data-theme="dark"] .m-logo.in-desktop-topbar img, | |
[data-theme="dark"] .m-logo.in-mobile-topbar img { | |
filter: invert(); | |
} | |
@media (prefers-color-scheme: dark) { | |
.m-logo.in-desktop-topbar img, | |
.m-logo.in-mobile-topbar img { | |
filter: invert(); |
OlderNewer