New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

compass-stitch

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compass-stitch

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Stitch CSS Pattern Framework

Patterns are chunks of styles that we use on every project. These chunks of styles generally perform a particular function, such as clearing floats. Having to write these styles each time is annoying and the function of these chunks of code in our stylesheets is obscure.

By breaking these patterns into reusable classes and mixins we:

  • Make our stylesheets free from clutter
  • Give our styles more meaning
  • Reduce the size of our stylesheet
  • Only have to write them once
  • Are updatable when newer methods are discovered by updating the framework

Get Stitch

Install the Rubygem.

gem install compass-stitch

Create a new project

Now create your bare project that includes compass-stitch:

compass create my-project --bare -r compass-stitch

Install the project template:

compass install stitch/project

Add Stitch to a current project

To add Stitch patterns to a current project, add this to the top of your stylesheets

@import 'stitch/patterns';

And in your Compass config.rb file add

require 'compass-stitch'

To use the project template layout, run

compass install stitch/project

and the project template will be installed into your current directory

Patterns

See all of the patterns available

By using @import 'stitch/patterns'; you will have access to all of the pattern mixins.

Reset

Stitch includes a CSS reset. This is a new reset I'm working on. It resets everything back to it's raw text form so that it's easy to build from.

To manually import the Stitch reset.

@import 'stitch/reset/desktop';

If you're using the Stitch project template, this will be included for you.

Stitch only includes a desktop reset for now.

Project Template

This project folder sets up the conventions for laying out your stylesheets. It is built around the idea that a single site may have many layouts and we'll use media queries to select which layout to use.

However, we don't want to ALWAYS use media queries, so we still have the option to import the layouts statically.

There are two files, master.scss and legacy.scss. Master imports the layouts based on media queries:

// Default Layout
@import "layouts/desktop/master.css" screen and (min-width: 481px);

// Adjusted default layout for smaller tablet screens
@import "layouts/tablet/master.css" screen and (min-width: 481px) and (max-width: 1024px);

// Adjusted layout for mobile devices
@import "layouts/mobile/master.css" screen and (max-width: 480px);

Whereas the legacy file will import files statically and without media queries. This means we can send the legacy file to browsers that don't support media queries, and we can send the master file to browsers that do.

FAQs

Package last updated on 26 Apr 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc