Coder Social home page Coder Social logo

css3's Introduction

CSS3

The most complete CSS support for Sublime Text 3.

Features

  • Absurdly Complete: I basically mined the entire set of draft specs and supported everything. Some of this stuff won't be implemented in browsers for years. With a few exceptions, if it's in the spec, it's supported.
  • Productive: Full set of completions for every property, including many prefixed properties. W3C Validation.
  • Modern: Bad, old CSS is flagged. Unnecessarily prefixed properties aren't highlighted. Catches lots of mistakes.
  • Faithful: Follows the spec extremely closely, with minor deviations that encourage a few best practices (see below).

Before & After

before and after 1 before and after 2

Installation

This package replaces my previous CSS3_Syntax plugin. This is a billion times better :)

  1. Install Package Control

  2. Install CSS3

    Platform Install Command
    Mac cmd+shift+p   → Package Control: Install Package → CSS3
    Linux ctrl+shift+p → Package Control: Install Package → CSS3
    Windows ctrl+shift+p → Package Control: Install Package → CSS3
  3. (Recommended) Disable the default CSS package

    Platform Disable Command
    Mac cmd+shift+p   → Package Control: Disable Package → CSS
    Linux ctrl+shift+p → Package Control: Disable Package → CSS
    Windows ctrl+shift+p → Package Control: Disable Package → CSS

    disabling the default CSS package

    Make sure you don't have any open files set to the default CSS syntax (bottom-right) or you may get an error message.

    Warning: may break other CSS plugins

  4. (Recommended) Disable Emmet

    If you have Emmet installed, its completions will appear alongside the carefully researched, standards-based completions included in this plugin. There are so many Emmet completions that they completely drown out the CSS3 completions. This wouldn't necessarily be a problem, except that Emmet is behind the times. The code it inserts is frequently bad. You're better off disabling it altogether. The Web will thank you.

  5. (Recommended) Set CSS3 as the default language for .css files

    • Open a .css file.
    • View → Syntax → Open all with current extension as... → CSS3

    setting CSS3 as default

    Warning: may break other CSS plugins

Best Practices

Known Issues

  1. Within nested code blocks, like inside a @media query, if the first selector starts with a letter, it will not be highlighted.

nested selector bug and workarounds

This is an annoying limitation of the Sublime Text syntax highlighting system. It can't recursively match curly braces across multiple lines. In this case, the first nested selector is mistaken for a property, which doesn't match. I went through three or four rewrites before I arrived at the current design, which is the least fragile and most predictable that I know. Other CSS highlighters, including my previous CSS3_Syntax and the Default CSS bundle, have the same problem, but are much easier to break. If this bugs you like it bugs me, two simple workarounds are shown above.

Help Me Out!

If you think something's missing, make sure you're not asking for something on this list of bad CSS properties. If it's not on that list, open an issue and I'll investigate. I'll be monitoring the specs as they're updated on the W3C feed, but I still need your help. Let's keep bad code out of the Web!

css3's People

Contributors

ryboe avatar

Watchers

 avatar  avatar  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.