From c44478783a18485653f29475fd38d5bc0b2f0534 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Tue, 6 Nov 2018 14:18:58 +0100 Subject: [PATCH] Fix bootstrap CSS issues in Safari and Chrome --- app/assets/javascripts/editor/editor.js.erb | 2 +- app/assets/stylesheets/base.css.scss | 16 +++++++++++++++- app/assets/stylesheets/editor.css.scss | 4 ---- app/views/exercises/_editor_button.html.slim | 2 +- app/views/exercises/_editor_output.html.slim | 2 +- app/views/exercises/implement.html.slim | 2 +- .../user_exercise_feedbacks/_form.html.slim | 2 +- 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/editor/editor.js.erb b/app/assets/javascripts/editor/editor.js.erb index 42f082f1..390b383e 100644 --- a/app/assets/javascripts/editor/editor.js.erb +++ b/app/assets/javascripts/editor/editor.js.erb @@ -84,7 +84,7 @@ configureEditors: function () { if (result.stderr && !result.score) { return 'card bg-danger text-white'; } else if (result.score < 1) { - return 'card bg-warning'; + return 'card bg-warning text-white'; } else { return 'card bg-success text-white'; } diff --git a/app/assets/stylesheets/base.css.scss b/app/assets/stylesheets/base.css.scss index 96087248..0f99cffa 100644 --- a/app/assets/stylesheets/base.css.scss +++ b/app/assets/stylesheets/base.css.scss @@ -15,15 +15,24 @@ i.fa { pre { background-color: #FAFAFA; margin: 0; - padding: 0; + padding: .25rem!important; + border: 1px solid #CCCCCC; } span.caret { margin-left: 0.5em; } +btn { + -webkit-font-smoothing: antialiased; + font-weight: 500; +} + .progress { margin: 0; + border: 1px solid #CCCCCC; + padding: 0.125rem !important; + height: 1.25rem !important; .progress-bar { line-height: initial; @@ -32,6 +41,11 @@ span.caret { } } +.nav-link { + -webkit-font-smoothing: antialiased; + font-weight: 500; +} + .attribute-row + .attribute-row { margin-top: 0.5em; } diff --git a/app/assets/stylesheets/editor.css.scss b/app/assets/stylesheets/editor.css.scss index 1b591fc8..dff00f6f 100644 --- a/app/assets/stylesheets/editor.css.scss +++ b/app/assets/stylesheets/editor.css.scss @@ -45,10 +45,6 @@ button i.fa-spin { width: 100%; display: flex; - button { - font-size: 80%; - } - button, .btn-group { flex-grow: 1; } diff --git a/app/views/exercises/_editor_button.html.slim b/app/views/exercises/_editor_button.html.slim index 7dd492d1..3c14f0b2 100644 --- a/app/views/exercises/_editor_button.html.slim +++ b/app/views/exercises/_editor_button.html.slim @@ -1,4 +1,4 @@ -button.btn class=local_assigns.fetch(:classes, 'btn-primary btn-lg') *local_assigns.fetch(:data, {}) disabled=local_assigns.fetch(:disabled, false) id=id title=local_assigns[:title] type='button' +button.btn class=local_assigns.fetch(:classes, 'btn-primary') *local_assigns.fetch(:data, {}) disabled=local_assigns.fetch(:disabled, false) id=id title=local_assigns[:title] type='button' i.fa.fa-circle-o-notch.fa-spin i class=(label.present? ? icon : "#{icon} m-0") = label diff --git a/app/views/exercises/_editor_output.html.slim b/app/views/exercises/_editor_output.html.slim index bd5f8486..0dcd3aba 100644 --- a/app/views/exercises/_editor_output.html.slim +++ b/app/views/exercises/_editor_output.html.slim @@ -40,7 +40,7 @@ div.h-100 id='output_sidebar_uncollapsed' class='d-none col-sm-12 enforce-bottom canvas#turtlecanvas.d-none width=400 height=400 div.enforce-big-top-margin #hint - .card.bg-warning + .card.bg-warning.text-white .card-header = t('exercises.implement.hint') .card-body div.enforce-big-top-margin diff --git a/app/views/exercises/implement.html.slim b/app/views/exercises/implement.html.slim index f90a838d..1e872cbf 100644 --- a/app/views/exercises/implement.html.slim +++ b/app/views/exercises/implement.html.slim @@ -2,7 +2,7 @@ #editor-column.col-md-12 .exercise.clearfix div - span.badge.badge-pill.float-right.score + span.badge.badge-pill.badge-primary.float-right.score h1 id="exercise-headline" i class="fa fa-chevron-down" id="description-symbol" diff --git a/app/views/user_exercise_feedbacks/_form.html.slim b/app/views/user_exercise_feedbacks/_form.html.slim index 15eec25b..a24a6e57 100644 --- a/app/views/user_exercise_feedbacks/_form.html.slim +++ b/app/views/user_exercise_feedbacks/_form.html.slim @@ -1,6 +1,6 @@ = form_for(@uef) do |f| div - span.badge.badge-pill.float-right.score + span.badge.badge-pill.badge-primary.float-right.score h1 id="exercise-headline" = t('activerecord.models.user_exercise_feedback.one') + " "