Giter Club home page Giter Club logo

trellisheets's Introduction

Trellisheets

Herein lies guidelines, base styles, tools, and examples for writing CSS for Trello.

Styleguide

The first thing you should do is read the styleguide.md. In general, break up your CSS into as many small, modular, encapsulated parts as possible, then import them as needed.

I’m making a new Trello site. How do I do that, briefly?

Copy the styles from /src. Copy the package.json, gulpfile.coffee, and tools/. Use ./tools/build to build. Tweak the tooling for your project. Strip any packages or components you don’t use.

I’m making a new Trello site. How do I do that, in detail?

We’re using…

You can replace LESS and Gulp with whatever you like, so long as you are adhere to the styleguide which you should read. The styles and tooling here are written for LESS, so it’s a good place to start.

All the packages for building our CSS are on npm. Use npm install to install them. You probably don’t want to include the packages in your project, so include node_modules in your .gitignore, like here.

Gulp builds the LESS files. You can use the example package.json and gulpfile.coffee to get started. Those are just boilerplate; you’ll change these for your project. Specifically, you don’t need http-server. You can just remove the line.

What’s in /tools? ./tools/build just calls the default gulp task which builds the files in /src/entries. These are minified and production-ready. ./tools/watch will watch for changes to style files and automatically rebuild them. Use this for development. You can bring your own scripts and tooling, of course.

You’ll likely have a core.css for all the pages on the site, then other CSS files for specific pages, depending on the size of the project. Gulp will build any files in /src/entries, so just add them there.

Reading through the style guide (have you read it yet?), you’ll see that we try and keep our CSS pretty vanilla. We don’t heavily rely on preprocessors. We mainly just use LESS for imports, variables, some mixins, and very shallow nesting (like &:hover).

Autoprefixer has been tremendously useful. You can write CSS to spec and it will write the vendor-prefixed declarations for you. No more -webkit-*. If we drop browsers in the future, all we have to do is change the browser list in the gulpfile. See browserslist for more information.

Are these the styles we use on the web client?

No. The web client doesn't use the base styles and components provided here, but it does stick to the style guide (please read it). These styles should be used as a starting point for almost everything else: blogs, landing pages, etc.

Where does brand-colors.less come from?

They are exported from Trellicolors, which is the canonical source. You can get them in LESS or SCSS flavored variables. Also check out the Colors section in the Brand Guide for how we use brand colors.

I want to edit or add stylesheets to this repo.

  1. Read the style guide.
  2. npm install
  3. Add CSS to src/**/ and import in respective /src/entries files.
  4. ./tools/watch, to build and watch styles
  5. ./tools/serve, to serve the site
  6. Visit localhost:8080 to test.
  7. Add to public/index.html or another example page.
  8. Make changes in a branch and open a pull request.

trellisheets's People

Contributors

bobbygrace avatar prayagverma avatar sime avatar stevenmaude avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trellisheets's Issues

Component layout in structure

Following the comment to corresponding gist:

My proposition is about using specific syntax for component layout. Namely this:

// Usage:
// <div class="component">
//   <p class="component-decendant">
//     <span class="component-decendant-descendant"></span>
//   </p>
// </div>
//
// (How it's used.)

I've come up with another way of illustrating component structure, that should be transparent enough.
This resulted in the project; you can find the documentation here.

And here is the practical example of some sort.

So the previous code could be re-written as this:

/* cssg

    component
        component-descendant
            component-descendant-descendant

*/

// all other code

There are some points backing this stuff:

  • html can be generated differently (jade, react, handlebars, ...), it is possible to write it once in css, but after some changes maintaining can become a problem (talking about 113 components ;))
  • in CSSG approach you illustrate all possible mods and states of component, not only one
  • it's easier to read and grasp the structure at a glance
  • easier to refactor and share snippets with colleagues

I'd like to take it to the next level actually and make a common thing between CSS-engaged front-end teams. Hope you'll find it useful as well!

Serve run problem

./tools/watch, to build and watch styles

[18:34:11] Requiring external module coffee-script/register
[18:34:13] Using gulpfile ~/workspace/github/trellisheets/gulpfile.coffee
[18:34:13] Starting 'watch'...
[18:34:13] Finished 'watch' after 19 ms

./tools/serve, to serve the site

Starting up http-server, serving ./public
Available on:
  http:127.0.0.1:8080
  http:192.168.0.109:8080
Hit CTRL-C to stop the server

But there is no /styles in ./public, so 404 for http://192.168.0.109:8080/styles/core.css

Is there something wrong with ./tools/watch ?

Sass version

Is a Sass port on the roadmap for this project?

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.