Coder Social home page Coder Social logo

mistobaan / figma-tailwindcss Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jan-dh/figma-tailwindcss

0.0 0.0 0.0 1.84 MB

A plugin that tries to bridge the gap between designs and code. Figma tailwindcss lets you export aspects of a design made in Figma to a javascript theme file that you can import into your tailwindcss config

JavaScript 81.83% CSS 18.14% HTML 0.03%

figma-tailwindcss's Introduction

Figma Tailwindcss

A plugin that tries to bridge the gap between design and code. Figma Tailwindcss lets you export aspects of a design made in Figma to a javascript theme file that can easily be used with Tailwindcss.

The plugin: Figma TailwindCSS


Table of Contents

Usage

Creating your theme

The plugin gets it's info from the Local Styles. At this point it picks up:

  • colors
  • font-families
  • text-sizes
  • box-shadow
  • border-radius

Colors

Colors are taken from the Figma Local Paint Styles. Colors can be grouped in the export step. If you want to group codes,prefix them with the same name.

Font-families

The plugin will pick up all font-families used in the Local Text Styles.

Text-sizes

All the different font-sizes used in the Local Text Styles will be picked up by the plugin. Pick a base font-size and the rest of the font-size names are calculated accordingly. The logic used:

...
'3xs'
'2xs'
'xs'
'sm'
'base'
'lg'
'xl'
'2xl'
'3xl'
...

The font-sizes the plugin spits out will also be converted into a rem based scale.

Box-shadows

Taken from the effectStyles from your document.

Border-radius

Taken from the nodeStyles from your document.

Importing your theme

Import the theme.js file in to your tailwind.config.js configuration file to use it:

Require syntax

const myTheme = require(./theme);

the require syntax will make sure your custom values get picked up by the Intelligent Tailwind CSS plugin. If you want to use this syntax, remove the export default theme statement from your theme file

Import syntax

import 'myTheme' from './theme

Extending the default theme

You can extend the default theme like so:

module.exports = {
    theme: {
        extend: {
            colors: myTheme.colors
        }
    }

More info on extending the default theme:

Contributing

All feedback is welcome. Feel free to submit issues or suggestions.

The plugin shows you some random messages when you're missing one of the exportable properties. If you want to add your own, feel free to make a Pull Request for this file.

Roadmap

  • line-height

License

This project is licensed under the terms of the MIT license.

figma-tailwindcss's People

Contributors

jan-dh avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.