Packages: [CSS] Proposal: Replace CSS Package with CSS3

Created on 4 Jul 2017  路  2Comments  路  Source: sublimehq/Packages

The default CSS package has improved a lot recently, but it still lags CSS3 in its support for the latest properties, selectors, @-rules, etc. If you look at some of my sample files, you can see lots of places where the default CSS package falls down. There are too many bugs to list, and IMHO the core Sublime devs shouldn't be spending their limited time on this one language when the work is already done.

I propose that CSS3 replace the default CSS package.

How Sublime would benefit

  • great CSS experience out of the box
  • fixes for lots of syntax highlighting issues
  • new completions
  • more specific completions
  • mistyped properties and values aren't highlighted

    • catches lots of typos

How CSS3 would benefit

  • proper CSS highlighting in HTML files
  • code review

Reasons you might want CSS3

  • pretty battle-hardened, after 211K installs
  • written in sublime-syntax format
  • 100% compatible with the new regex engine
  • no settings files ("no knobs")
  • I will commit to submitting regular PRs to keep sublimehq/Packages/CSS up to date with the latest W3C spec changes, as I've been doing for CSS3.

    • structure of the completions files and sublime-syntax file has been designed to be easy to maintain

  • everything is currently MIT-licensed. I'm happy to donate all the code to this project.

Reasons you might not want CSS3

  • CSS3 is opinionated

    • no completion for !important

    • don't want to make it easy to type this

    • no completions for prefixed properties like -webkit- and -moz-

    • Users shouldn't be writing prefixes themselves. They should let a tool like Autoprefixr do that for them.

    • prefixed properties, etc. are still highlighted just fine

    • I'm happy to change any of this! 馃槃

  • sublime-syntax definition is huge

    • includes individual rules for 300+ properties

    • still quite fast because of the new regex engine

  • CSS3 isn't perfect. I know there are still highlighting mistakes here and there. There's just a lot fewer of them than the default CSS package.

CSS3's biggest problem currently is that it's not compatible with the default HTML package. I encourage my users to disable the default CSS package when they install CSS3. This prevents conflicts when editing .css files, but breaks CSS highlighting in .html files (with the default HTML package). This problem would go away if CSS3 _were_ the default CSS package.

Most helpful comment

After some discussion, it was decided that replacing the default package completely would cause too many breakages. The path forward is to update the default package, and fix some of the issues I pointed out. Thanks to everyone who participated in the discussion!

All 2 comments

After some discussion, it was decided that replacing the default package completely would cause too many breakages. The path forward is to update the default package, and fix some of the issues I pointed out. Thanks to everyone who participated in the discussion!

Was this page helpful?
0 / 5 - 0 ratings