what makes sass so syntactically awesome?

36
Camp Sass April 19 , 2014 Thank Hampton and Michael

Upload: chriseppstein

Post on 13-Jun-2015

899 views

Category:

Technology


1 download

DESCRIPTION

Chris Eppstein's Keynote presentation at Camp Sass on April 19, 2014

TRANSCRIPT

Page 1: What makes Sass so Syntactically Awesome?

Camp SassApril 19, 2014

Thank Hampton and Michael

Page 2: What makes Sass so Syntactically Awesome?

Who am I?

Creator of Compass

Sass Developer

Family man

Engineer at LinkedIn

* New Baby in November* LinkedIn pays me to work on Open Source Software

Page 3: What makes Sass so Syntactically Awesome?

I don’t think that Sass is good because it’s an abstraction; I

think that Sass is good because it’s a we!-designed abstraction. Crucia!y, it’s also easy to learn

…just like CSS.– Jeremy Keith

Page 4: What makes Sass so Syntactically Awesome?

What makes Sass so Syntactically Awesome?

A story of taste, co!aboration, and responsiveness.

Page 5: What makes Sass so Syntactically Awesome?

“It's a new syntax that I don't want to learn or support.”

“It's a terrible idea for a CSS preprocessor to be whitespace sensitive.”

“Good luck supporting two syntaxes.”

“Why the $ak do I need control directives in CSS?”

–Nathan Borror circa 2009

Page 6: What makes Sass so Syntactically Awesome?

Sass 2.0 Source

* I thought this kinda sucked but not for any of the reasons it does.* good things: left-side-scannable, merge conflicts, I like white-space* Bad things: repetition -- sass 2.2 fixed this.

Page 7: What makes Sass so Syntactically Awesome?

Sass 3.3 Source

Page 8: What makes Sass so Syntactically Awesome?

Sass 2.0 Output

Page 9: What makes Sass so Syntactically Awesome?

Sass 3.3 Output

Same input API, more configurable/flexible, equivalent to hand-crafted output.

Page 10: What makes Sass so Syntactically Awesome?

How did we get here?

Page 11: What makes Sass so Syntactically Awesome?

Sass’s Vision

Make CSS syntactica!y similar to Ruby and Haml.

Page 12: What makes Sass so Syntactically Awesome?

Sass’s Vision

Make the experience of authoring stylesheets truly enjoyable

Chris Wright’s talk: “joy & excitement”. Every day I see a tweet where someone thanks the internet that Sass exists.

Page 13: What makes Sass so Syntactically Awesome?

What Makes Writing Sass Enjoyable?

Creative Expression.

Remove Drudgery.

Clear understanding of how Sass works.

Straightforward debu%ing.

Trust.

Page 14: What makes Sass so Syntactically Awesome?

A Problem

No one on the Sass core team writes stylesheets for a living.

My life has taken me down a path that doesn’t involve as much front-end code.I don’t think this is a big problem with the right process and approach.Not a hero -> a servant.

Page 15: What makes Sass so Syntactically Awesome?

We Listen

Features are added tosolve the needsof CSS authors.

Page 16: What makes Sass so Syntactically Awesome?

We Listen

I find myself o!en doing X,if Sass did Y,

then X would be simpler & more maintainable.

Even if you don’t know what Y is, once you’ve discovered a pattern, I guarantee you we want to solve it.

Page 17: What makes Sass so Syntactically Awesome?

We Listen

Page 18: What makes Sass so Syntactically Awesome?

We Listen... to the trolls.

Be careful who you ca! a tro!.

Most tro!s are speaking to some form of the truth.

People who speak out against are o&en tech promoters too.

Public critique != trollingReal trolls are trying to make you angry. Genuine engagement is often not expected and is disarming.

Page 19: What makes Sass so Syntactically Awesome?

Personal PrideWe never ship anything we don’t love.

Page 20: What makes Sass so Syntactically Awesome?

Minutia Matters

Naming.

Edge cases.

Aesthetics.

Error messages.

Page 21: What makes Sass so Syntactically Awesome?

Not a Democracy

Consensus breeds mediocrity.

Great projects require great leaders. The quality of the Sass language is thanks to Nathan’s unwavering commitment to perfection (or as close as we can approximate our understanding of perfection)

Page 22: What makes Sass so Syntactically Awesome?

New Feature Evaluation

What other ways are there to accomplish the same feature in Sass or CSS.

How does the feature interact with the other Sass features?

Is it intuitive?

Does it make things harder to maintain?

Potential for misuse?

Page 23: What makes Sass so Syntactically Awesome?

Import globbing

strip-­‐unit function

@include  foo  !important

Properties that are mixins.

@extend  within  @media.

We (Kind-of) Listen

Give users what they need, not what they ask for.

Page 24: What makes Sass so Syntactically Awesome?

@extend within @media

Sometimes the request, as made, cannot be fulfilled.

We would love to allow user to write this.

Page 25: What makes Sass so Syntactically Awesome?

@extend within @media

Users wanted Sass to move the selectors involved in the @extend query to the media query.

Moving selectors is a very dangerous operation and can break expectations based on source order.Furthermore, the act of moving selectors is more like @include another break of expectation

Page 26: What makes Sass so Syntactically Awesome?

@extend within @media

After approximately 1000 requests for this feature it occurred to us that there was another possible output, that while bloated, didn’t behave unpredictably.

Page 27: What makes Sass so Syntactically Awesome?

We Listen

“In preparation for its release, we've put out a couple of release candidates to be sure that everything was set and ready to go. Unfortunately, it wasn't.”

Usually, it falls on Nathan and me to tell other people why their features do not cut the mustard. But in this case, the community told us. & in SassScript failed to be intuitive for the use case of handling multiple parent selectors. Full write up: https://gist.github.com/nex3/8050187

Page 28: What makes Sass so Syntactically Awesome?

PatienceA Virtue it is

Page 29: What makes Sass so Syntactically Awesome?

Understanding cannot be rushed.

When we don’t know, we wait.We trust our instincts that something is not right.

Page 30: What makes Sass so Syntactically Awesome?

Long Release Cycles

Let the community adjust

Provide stability

Fewer features, more thought

Page 31: What makes Sass so Syntactically Awesome?

This Was Amazing to 2008 Me

Page 32: What makes Sass so Syntactically Awesome?

“It's a new syntax that I don't want to learn or support.”

“It's a terrible idea for a CSS preprocessor to be whitespace sensitive.”

“Good luck supporting two syntaxes.”

“Why the $ak do I need control directives in CSS?”

–Nathan Borror circa 2009

We were pretty sure control directives did make sense. and it was thanks to the weird syntax...

Page 33: What makes Sass so Syntactically Awesome?

We Need You!Subscribe to the issue tracker & watch issues that look interesting to you.

Help triage common issues

Confirm bug reports and improve the information about them.

Identify the commit that caused a regression (git bisect!)

Provide a workaround for the user

Leave us useful issue comments ~

Disagree with us!

Te! us when we’re on the right track

Page 34: What makes Sass so Syntactically Awesome?

Community Interaction GuidelinesNot everyone is going to be as tapped into Sass development as you.

Educate, don't chastise.

The correct response to someone who is being an entitled jerk is to disengage.

Page 35: What makes Sass so Syntactically Awesome?

We Need You!Test new features in alpha releases.

Blog about your experiences. Think out loud.

Speak at local meet-ups.

Make feature su%estions

Polish patches - Documentation improvement

Sass-lang.com documentation.

Page 36: What makes Sass so Syntactically Awesome?

Thank You!

I hope this talk has helped you understand how Sass works& more genera!y, a way of running and working with open source projects.