Detalhes do pacote

scut

ramseyinhouse2.8kMIT2.0.0

A collection of Sass utilities to ease and improve our implementations of common style-code patterns.

SCSS, Sass, style, eyeglass-module

readme (leia-me)

Scut

— a collection of Sass utilities to ease and improve our implementations of common style-code patterns.

For a prolonged introduction to Scut, read "Introducing Scut" on CSS-Tricks.

If you have any questions about Sass, they are answered in Sass's fine documentation.

Ownership

Scut was originally developed and owned by David Clark (@DavidTheClark). On January 21, 2022, David decided to transfer ownership of this GitHub repository to RamseyInHouse (@RamseyInHouse) where it will be maintained and updated for the foreseeable future.

Installing and Using

Please visit the complete documentation here:
http://ramseyinhouse.github.io/scut/

Usage should be explained there, as is installation. But I'll explain installation here, too, for your convenience. You can install Scut by:

  • Using Bower: bower install scut --save-dev.
  • Downloading the file from the latest release.
  • Using Scut as a Compass extension by installing the RubyGem (gem install scut) and then performing the usual Compass require and @import business.
  • Using node-sass and eyeglass:
    • npm install --save-dev scut
    • setup render per eyeglass instructions
    • in sass files: @import 'scut'

Contributing

Please do! Scut is simple; contributing should be easy. So give it a go.

If you have any questions, if anything about this document is unclear or inaccurate, if you can't figure out what to do, please file an issue or contact me.

Approach

Scut utilities should help users avoid repetition, organize code, and re-use code.

Scut utilities should tackle patterns that suffer from one or more of the following problems:

  1. The pattern is non-intuitive.
  2. The pattern deserves a shorthand.
  3. The pattern involves some important best practices.
  4. The pattern is extremely common and (at least) a little annoying.

The utility's goal is to fix those problems in a way that maximizies reusability. Here are some principles to keep in mind to maximize that reusability:

  • Include sufficient detail to implement the pattern, but no more.
  • Use arguments to allow for typical variations on the theme.
  • Arrange those arguments according to the likelihood that users will want to change them.
  • Namespace (notice the scut- prefix everwhere).
  • Document thoroughly.

I go into detail about all these ideas in that CSS-Tricks article.

Development Requirements

Writing Scut Utilities

The utilities are in src/, organized by category. The SCSS stylesheets in src/ ultimately concatenate into dist/_scut.scss, which is what users @import into their own Sass.

Scut's SCSS Styleguide

Please have a look at existing SCSS files within src/ and try to match their style.

(Or, if you think there's a better way to do things, please file an issue.)

Here are some guidelines to explain how I've been writing:

  • Head the file with a multi-line comment (each line an inline // comment, not a block comment) naming the utility and listing any dependencies. Limit dependencies please. In the end, that top comment should also contain the URL of the utility's documentation. For example:
// SCUT PIXELS TO EMS
// http://ramseyinhouse.github.io/scut/#pixels-to-ems

// Depends on `scut-strip-unit`.
  • Indent with two spaces.
  • List arguments on separate lines, so they are easy to scan. For example:
@mixin scut-color-swap (
  $inactive,
  $active,
  $duration: 0,
  $bg: false
) {
  // mixin content
}
  • Space liberally. A space at the beginning and end of mixins and functions helps distinguish the arguments from the inner workings. Spacing can also help delineate different "sections" of the code by grouping rules that work together and separating those with different roles.

Experimenting and Testing

The method I recommend for experimentation and testing is to use Codepen, either starting your own pen from scratch or forking the Scut Playground (which imports the latest version of Scut).

(I have deleted the "tests" directory and tasks from the repository in favor of relying on Codepen.)

Documenting

Documentation is compiled using Assemble. The source files are located in docs/content and docs/dev. You'll need to bower install to get Normalize.

changelog (log de mudanças)

Changelog

2.0.0

1.4.4

  • Remove math.div for LibSass support.

1.4.3

1.4.2

  • Updated ownership.

1.4.1

1.4.0

  • Added common currencies to scut-characters

1.3.1

  • Fixed eyeglass support.
  • Lowered specificity of scut-reset-button

1.3.0

  • Added list-unstyled.

1.2.1

  • Fixed bug in vcenter quoting inner selectors.

1.2.0

1.1.3

1.1.2

  • Changed scut-reverse-italics to avoid Sass deprecation warning.

1.1.0

  • Added woff2 format to scut-font-face.

1.0.2

  • Made all elements inherit -webkit-font-smoothing in scut-reset-antialias, to target elements that need specific targeting.

1.0.1

1.0.0

  • Changed box-sizing reset to use inheritance.

0.10.4

  • No longer remove outline from button as part of scut-reset-button.
  • Added use of selector lists for scut-vcenter-td and scut-vcenter-ib.

0.10.3

  • Added scut-reset-figure.
  • Added input[type="submit"] and input[type="reset"] to scut-reset-button.

0.10.2

  • Added scut-reset-media.
  • Changed scut-sticky-footer to scut-sticky-footer-fixed in order to add a new sticky footer mixin, scut-sticky-footer-fluid.
  • Added scut-color-swap back in, because some people liked it.

0.10.1

  • Fixed bug in build process.

0.10.0

  • Added some squares to characters: $scut-square, $scut-whitesquare, $scut-ssquare, $scut-swhitesquare.
  • Removed scut-color-swap, scut-bookends, and scut-fonticon-label because I never ended up using them.

0.9.1

  • Updated scut-font-face so users can enter there own $formats list, if they don't want to include all font-file-formats.

0.9.0

  • Documented scut-reset so that others might understand.
  • Added $no-margin variable to list mixins, with the default value true.
  • Made scut-font-face's argument $weight optional.
  • Removed inner element from scut-ratio-box, as the user can add it herself if she wants it (and she may not want it).
  • Exposed the $scut-rem-base default value to users.

0.8.0

  • Fixed a bug preventing the results of scut-em and scut-rem from being used in calculations.
  • Added scut-truncate.
  • Deleted "tests" in repository. Devs should use Codepen. It's easy.
  • Updated scut-reset. Some substance-changes and specific resets are now excludable.

0.7.1 and 0.7.2

  • Bug fixes.

0.7.0

  • Updated scut-list-unstyled for less aggressive resetting; modified related utilities to fit.
  • Updated scut-fill for two different filling approaches: all coordinates = 0 or width/height = 100%.
  • Updated scut-em to accept lists of pixel-values and exposed the $scut-em-base default value to users.
  • Added scut-rem and scut-rem-fallback.
  • Added scut-list-custom.
  • Added scut-center-trasform and scut-vcenter-tt.

0.6.0

  • Added RubyGem config so Scut can be used as a standard Compass extension.
  • Modified scut-margin and scut-padding.
  • Added scut-center-block.
  • Changed scut-hide-text to scut-image-replace and added scut-hide-visually.
  • Moved scut-triangle and scut-circle to General category; removed scut-foursquare; and removed Shapes category.
  • Replaced block comments with in-line comments.

0.5.0

  • Added scut-border.

0.4.1

  • Fixed bug with scut-foursquare: it requires box-sizing: border-box.

0.4.0

  • Started changelog!