From 84286fb501d2f313daec398cb07bb2d4c0e9ed40 Mon Sep 17 00:00:00 2001 From: Jeff Atwood Date: Mon, 12 Jan 2015 02:24:06 -0800 Subject: [PATCH] normalize topic post first element top-margins:0 --- app/assets/stylesheets/common/base/compose.scss | 9 +++++++++ app/assets/stylesheets/common/base/topic-post.scss | 9 +++++++++ app/assets/stylesheets/desktop/compose.scss | 5 ----- app/assets/stylesheets/desktop/topic-post.scss | 14 ++------------ app/assets/stylesheets/mobile/topic-post.scss | 9 --------- 5 files changed, 20 insertions(+), 26 deletions(-) diff --git a/app/assets/stylesheets/common/base/compose.scss b/app/assets/stylesheets/common/base/compose.scss index 6584fc3b54..f4f7dad9d5 100644 --- a/app/assets/stylesheets/common/base/compose.scss +++ b/app/assets/stylesheets/common/base/compose.scss @@ -140,3 +140,12 @@ div.ac-wrap { top: 20%; } } + +// this removes the topmost margin from the first element in the topic post +// if we don't do this, all posts would have extra space at the top +#wmd-preview > *:first-child { + margin-top: 0; +} +.cooked > *:first-child { + margin-top: 0; +} diff --git a/app/assets/stylesheets/common/base/topic-post.scss b/app/assets/stylesheets/common/base/topic-post.scss index 38a24bd6e4..53f911cef7 100644 --- a/app/assets/stylesheets/common/base/topic-post.scss +++ b/app/assets/stylesheets/common/base/topic-post.scss @@ -173,3 +173,12 @@ kbd * * { display: none; } } + +// we assume blockquotes have their own margins, so all blockquotes +// will remove margins from first (top) and last (bottom) child elements +blockquote > *:first-child { + margin-top: 0 !important; +} +blockquote > *:last-child { + margin-bottom: 0 !important; +} diff --git a/app/assets/stylesheets/desktop/compose.scss b/app/assets/stylesheets/desktop/compose.scss index e326531bf1..5c9032b742 100644 --- a/app/assets/stylesheets/desktop/compose.scss +++ b/app/assets/stylesheets/desktop/compose.scss @@ -349,11 +349,6 @@ bottom: 48px; top: 50px; - // this removes the topmost margin; - // if we don't have this, all posts would have extra space at the top - #wmd-preview > *:first-child { - margin-top: 0 !important; - } #wmd-input, #wmd-preview-scroller, #wmd-preview { box-sizing: border-box; diff --git a/app/assets/stylesheets/desktop/topic-post.scss b/app/assets/stylesheets/desktop/topic-post.scss index bb9581145f..c66397066a 100644 --- a/app/assets/stylesheets/desktop/topic-post.scss +++ b/app/assets/stylesheets/desktop/topic-post.scss @@ -243,8 +243,8 @@ nav.post-controls { } .topic-avatar { - width: 45px; - padding-left: 15px; + padding-left: 15px; + padding-top: 0; } // bottom means "reply expansion" below a post @@ -646,16 +646,6 @@ blockquote { a.mention {background: darken(scale-color-diff(), 10%);} } -// we assume blockquotes have their own margins, so all blockquotes -// will remove margins from first (top) and last (bottom) child elements -blockquote > *:first-child { - margin-top: 0 !important; -} -blockquote > *:last-child { - margin-bottom: 0 !important; -} - - /* quotes with attribution */ .quote { &>blockquote { diff --git a/app/assets/stylesheets/mobile/topic-post.scss b/app/assets/stylesheets/mobile/topic-post.scss index a0ca378f1a..133a0fccef 100644 --- a/app/assets/stylesheets/mobile/topic-post.scss +++ b/app/assets/stylesheets/mobile/topic-post.scss @@ -423,15 +423,6 @@ blockquote { margin-right: 0; } -// we assume blockquotes have their own margins, so all blockquotes -// will remove margins from first (top) and last (bottom) child elements -blockquote > *:first-child { - margin-top: 0 !important; -} -blockquote > *:last-child { - margin-bottom: 0 !important; -} - .gutter { display: none; } .posts-wrapper { position: relative; }