Sha256: fa492b44bf6cd59c116a6dccdbf2987493a5cb16d6d34e74c7c89f8e1b6ce389

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

# frozen_string_literal: true

require_relative 'icon'

module Fatcow
  module Helpers
    def fci(name, status = nil)
      Fatcow::Icon.new(self, name, status)
    end

    def fatcow_style_tag
      content_tag :style do <<~CSS
          .fatcow-icon {
            display: inline-block;
            position: relative;
            image-rendering: crisp-edges;
            user-select: none;
          }
          
          .fatcow-icon__bullet {
            position: absolute;
            top: 0;
            left: 0;
            transform: translate(25%, 25%);
          }
         
          .fatcow-icon > img:not(.fatcow-icon__bullet--hack) {
            width: 100%;
          }
            
          .fatcow-icon__bullet--pre-aligned {
            transform: none;
          }

          .fatcow-icon--small .fatcow-icon__bullet--hack {
            display: inline-block;
            position: static;
            transform: none;
            margin-left: 4px;
          }

          .fatcow-icon:not(.fatcow-icon--small) .fatcow-icon__bullet--hack {
            transform: none;
            bottom: 0;
            right: 0;
            top: initial;
            left: initial;
          }
        CSS
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fatcow-0.1.5 lib/fatcow/helpers.rb
fatcow-0.1.4 lib/fatcow/helpers.rb
fatcow-0.1.3 lib/fatcow/helpers.rb