前提
rails 初心者です。
simple calendar を使って、カレンダーを作成してscssで見た目を変えたいと思っているのですが、scssがうまく反映してくれず困っています。
ローカルホストと検証ツールを開いた状態でVScodeのscssに土日の曜日の色を変えるなどの記述をして、ローカルホストをリロードすると、
<body data-new-gr-c-s-check-loaded="14.1058.0" data-gr-ext-installed> <grammarly-desktop-integration data-grammarly-shadow-root="true">が一瞬ハイライト表示されてscssが反映されず、下記のようにターミナル上に表示が出てきます。
実現したいこと
scssの記述が反映させて、見た目を整えたい
発生している問題・エラーメッセージ
ターミナルに表示されている文です。
Started GET "/calendars" for ::1 at 2022-05-06 10:57:29 +0900 (0.7ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC Processing by CalendarsController#index as HTML Rendering calendars/index.html.erb within layouts/application Calendar Load (0.3ms) SELECT `calendars`.* FROM `calendars` ↳ app/views/calendars/index.html.erb:9 Rendered simple_calendar/_month_calendar.html.erb (Duration: 193.9ms | Allocations: 360929) Rendered calendars/index.html.erb within layouts/application (Duration: 197.6ms | Allocations: 362736) [Webpacker] Everything's up-to-date. Nothing to do Completed 200 OK in 1268ms (Views: 1247.3ms | ActiveRecord: 4.9ms | Allocations: 2059231)
この部分が原因で反映できていないと思うのですがvscodeで画像に記述されているコードが見つからなかったので検証ツールの画像を添付させていただきます。
https://gyazo.com/26079f66eae8a7eb33db8fb06ee024c3
該当のソースコード
index.html.erb
<p id="notice"><%= notice %></p> <%= link_to 'トップページ', users_path %> <div class="toppage"> <h1 class="top">カレンダー</h1> <br> <div class="col-md-8"><%= link_to 'メモを追加', new_calendar_path %> <%= month_calendar events: @calendars do |date, calendars| %> <%= date.day %> <% calendars.each do |calendar| %> <div> <%= link_to calendar.title, calendar %> </div> <% end %> <% end %> </div> <br> <br> <div class="row"> <div class="col-md-4"> <div class="schedule">今後の予定一覧</div> <table class="table"> <thead class="thead-light"> <tr> <th>タイトル</th> <th>日程</th> </tr> </thead> <tbody> <% @calendars.each do |calendar| %> <tr> <td><%= link_to calendar.title , calendar %></td> <td><%= calendar.start_time.strftime("%m-%d") %></td> </tr> <% end %> </tbody> </table> </div> </div> </div>
calendars.scss
.col-md-8 { float: left; width: 60%; position: relative; padding-left: 15px; padding-right: 15px; } .schedule { font-size: 25px; font-weight: bold; padding-bottom: 20px; } .table>thead>tr>th { border-bottom: 2px solid #ddd; padding: 8px; text-align: center; } .col-md-4 { float: left; width: 35%; } .top { text-align: center; } .wday-0 a { color: red; } .wday-6 a { color: blue; }
試したこと
ググってみましたが、有益な情報は得られませんでした。
解決法がわかる方はご教授よろしくお願い致します。
あなたの回答
tips
プレビュー