Skip to content

Instantly share code, notes, and snippets.

View didoo's full-sized avatar

Cristiano Rastelli didoo

View GitHub Profile
@davo
davo / Grid.tsx
Last active September 15, 2018 16:28
CSS Grid for Framer X
import * as React from 'react'
const container: React.CSSProperties = {
width: '100%',
height: '100%',
display: 'grid',
gridTemplateColumns: '10rem 10rem 10rem 10rem'
}
const item: React.CSSProperties = {
@aalokt89
aalokt89 / ImagePost.tsx
Last active June 16, 2019 18:09
Framer X Stack with design and code components
import * as React from "react";
import { Frame, Stack, PropertyControls, ControlType } from "framer";
import { Avatar, PostHeader, PostImage, PostButtonGroup } from "./canvas";
// Define type of property
interface Props {
username: string;
timeStamp: string;
postText: string;
width: number;
@romannurik
romannurik / tab-widget.tsx
Created August 23, 2018 15:51
A proof-of-concept Tab widget for Framer X
import { ControlType, PropertyControls } from "framer";
import * as React from "react";
interface TabWidgetProps {
selectedTab: number;
accentColor: string;
}
@aalokt89
aalokt89 / LayerComponent.tsx
Created August 26, 2018 18:36
Framer X Data and props Animation
import * as React from "react";
import {
Frame,
Data,
Animatable,
animate,
PropertyControls,
ControlType
} from "framer";
static propertyControls: PropertyControls = {
text: { type: ControlType.String, title: 'Text' },
fontSize: {
type: ControlType.FusedNumber,
toggleKey: 'fontPerBP',
toggleTitles: ['Font', 'Font per BP'],
valueKeys: ['font1', 'font2', 'font3', 'font4'],
valueLabels: theme.breakpoints.map(s => s.replace('px', '')),
min: 0,
title: 'Font Size',
@machty
machty / ember-cli-build.js
Last active November 25, 2022 13:21
Broccoli challenges
/* jshint node: true */
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const generateWhitelabelIndexes = require('./generate-whitelabel-indexes');
module.exports = function(defaults) {
const app = new EmberApp(defaults, {
// ...all sorts of config
});
@alexjlockwood
alexjlockwood / print-unlinked-colors.ts
Created February 3, 2020 21:41
Prints nodes that have fill/stroke colors that aren't linked to a style.
figma.root.children
.flatMap(pageNode => pageNode.findAll(n => true))
.forEach(node => {
if ('fills' in node && 'fillStyleId' in node) {
if (node.fills !== figma.mixed && node.fills.length > 0 && node.fillStyleId !== '') {
print(`${node.name}'s fill color is not linked to a style`);
}
}
if ('strokes' in node && 'strokeStyleId' in node) {
if (node.strokes.length > 0 && node.strokeStyleId !== '') {