Sha256: dca033aaa25c627b36436c95fa10641171f9fe85e5babd4e46c0ba48be7b6235

Contents?: true

Size: 1.59 KB

Versions: 12

Compression:

Stored size: 1.59 KB

Contents

# frozen_string_literal: true

require_relative "functional_colors"

module Primer
  class Classify
    # Border specific functional colors
    # https://primer-css-git-mkt-color-modes-docs-primer.vercel.app/css/support/v16-migration#border
    class FunctionalBorderColors < FunctionalColors
      FUNCTIONAL_OPTIONS = {
        primary: :primary,
        secondary: :secondary,
        tertiary: :tertiary,
        info: :info,
        success: :success,
        warning: :warning,
        danger: :danger,
        inverse: :inverse
      }.freeze

      MAPPINGS = {
        gray: FUNCTIONAL_OPTIONS[:primary],
        gray_light: FUNCTIONAL_OPTIONS[:secondary],
        gray_dark: FUNCTIONAL_OPTIONS[:tertiary],
        blue: FUNCTIONAL_OPTIONS[:info],
        green: FUNCTIONAL_OPTIONS[:success],
        yellow: FUNCTIONAL_OPTIONS[:warning],
        red: FUNCTIONAL_OPTIONS[:danger],
        white: FUNCTIONAL_OPTIONS[:inverse]
      }.freeze

      OPTIONS = FUNCTIONAL_OPTIONS.values.freeze
      OPTIONS_WITHOUT_MAPPINGS = [:gray_darker, :blue_light, :red_light, :purple, :black_fade, :white_fade].freeze
      DEPRECATED_OPTIONS = [*MAPPINGS.keys, *OPTIONS_WITHOUT_MAPPINGS].freeze

      class << self
        def color(val)
          functional_color(
            key: "border",
            value: val,
            mappings: MAPPINGS,
            non_functional_prefix: "border",
            functional_prefix: "color-border",
            number_prefix: "border",
            functional_options: OPTIONS,
            options_without_mappigs: OPTIONS_WITHOUT_MAPPINGS
          )
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
primer_view_components-0.0.57 lib/primer/classify/functional_border_colors.rb
primer_view_components-0.0.56 lib/primer/classify/functional_border_colors.rb
primer_view_components-0.0.55 lib/primer/classify/functional_border_colors.rb
primer_view_components-0.0.54 lib/primer/classify/functional_border_colors.rb
primer_view_components-0.0.53 lib/primer/classify/functional_border_colors.rb
primer_view_components-0.0.52 lib/primer/classify/functional_border_colors.rb
primer_view_components-0.0.51 lib/primer/classify/functional_border_colors.rb
primer_view_components-0.0.50 lib/primer/classify/functional_border_colors.rb
primer_view_components-0.0.49 lib/primer/classify/functional_border_colors.rb
primer_view_components-0.0.48 lib/primer/classify/functional_border_colors.rb
primer_view_components-0.0.47 lib/primer/classify/functional_border_colors.rb
primer_view_components-0.0.46 lib/primer/classify/functional_border_colors.rb