{"id":248929,"date":"2016-12-12T13:53:40","date_gmt":"2016-12-12T20:53:40","guid":{"rendered":"http:\/\/css-tricks.com\/?p=248929"},"modified":"2016-12-12T13:53:56","modified_gmt":"2016-12-12T20:53:56","slug":"css-shorthand-syntax-considered-anti-pattern","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/css-shorthand-syntax-considered-anti-pattern\/","title":{"rendered":"CSS Shorthand Syntax Considered an Anti-Pattern"},"content":{"rendered":"

I remember Estelle Weyl used to mention this a lot in her talks. If you set .button { background: red; }<\/code> you’ve, inadvertently or not, set a whole slew of other properties to their initial values. Harry Roberts demonstrates this clearly and goes so far to say it’s a bad practice. <\/p>\n

I don’t avoid it, but I do actively think about it every time I’m about to use a shorthand. I think “I’m not just doing this to be lazy, I’m doing it because I actively want to set all these values.”<\/em> Plus, the bigger and more unfamiliar the codebase, the less likely I am to use shorthand.<\/p>\n","protected":false},"excerpt":{"rendered":"

I remember Estelle Weyl used to mention this a lot in her talks. If you set .button { background: red; } you’ve, inadvertently or not, set a whole slew of other properties to their initial values. Harry Roberts demonstrates this clearly and goes so far to say it’s a bad practice. I don’t avoid it, […]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"c2c_always_allow_admin_comments":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":[]},"categories":[17],"tags":[957],"jetpack_publicize_connections":[],"acf":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/248929"}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=248929"}],"version-history":[{"count":1,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/248929\/revisions"}],"predecessor-version":[{"id":248930,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/posts\/248929\/revisions\/248930"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=248929"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/categories?post=248929"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=248929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}