Refactor question styles

- Created styles in component/question
- Removed old styles from scss/panel
- Moved question partial to question controller resource, as it is only used there, not shared
This commit is contained in:
Andreas Nedbal 2020-04-30 00:44:43 +02:00
parent e8bbf2c2f1
commit d61fa91f0d
5 changed files with 19 additions and 31 deletions

View File

@ -100,7 +100,8 @@ $navbar-inverse-toggle-border-color: #512da8;
@import
"components/avatars",
"components/buttons",
"components/jumbotron";
"components/jumbotron",
"components/question";
body { padding-top: 50px; }

View File

@ -0,0 +1,14 @@
.question {
&--fixed {
position: fixed;
width: 100%;
z-index: 999;
}
&--hidden {
visibility: hidden;
position: relative;
box-shadow: none;
z-index: -1;
}
}

View File

@ -12,28 +12,3 @@
.panel-primary .answerbox--question-text {
color: #fff;
}
#questions .panel-body .media {
&, .media-body {
overflow: visible;
}
}
.panel-question {
position: fixed;
border-top: 1px solid #fff;
width: 100%;
z-index: 999;
border-color: #fff;
}
.panel-question.question-hidden {
visibility: hidden;
position: relative;
box-shadow: none;
z-index: -1;
}
.answerbox--question-media, .question-media, .question-body {
overflow: visible !important;
}

View File

@ -1,4 +1,4 @@
.card.card-question{class: if hidden then 'question-hidden' end, tabindex: if hidden then '-1' end, aria: { hidden: if hidden then :true end }}
.card.question--fixed{class: if hidden then 'question--hidden' end, tabindex: if hidden then '-1' end, aria: { hidden: if hidden then :true end }}
.container
.card-body
.media.question-media

View File

@ -1,9 +1,7 @@
- provide(:title, question_title(@question))
= render 'shared/question_header', question: @question, hidden: false
= render 'shared/question_header', question: @question, hidden: true
= render 'question', question: @question, hidden: false
= render 'question', question: @question, hidden: true
.container.question-page
/ TODO: make this pretty (it's currently C-c'd straight from shared/_answerbox)
#answers
- @answers.each do |a|
= render 'answerbox', a: a, show_question: false