summaryrefslogtreecommitdiff
path: root/app/helpers/gitlab/broadcast_messages_helper.rb
blob: 93f0b0ec5ae207a1a3cab91a4664723e79e36f4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module Gitlab
  module BroadcastMessagesHelper
    def broadcast_styling(broadcast_message)
      styling = ''

      if broadcast_message.color.present?
        styling << "background-color: #{broadcast_message.color}"
        styling << '; ' if broadcast_message.font.present?
      end

      if broadcast_message.font.present?
        styling << "color: #{broadcast_message.font}"
      end

      styling
    end
  end
end