Fix contrast issues with text-muted and bg-dark classes
- Fixed Bootstrap bg-dark class to use better contrasting color - Added comprehensive text-muted contrast fixes for various contexts - Improved dark theme colors for better accessibility - Fixed CSS inheritance issues for code elements in dark contexts - All color choices meet WCAG AA contrast requirements
This commit is contained in:
115
scripts/colors.mk
Normal file
115
scripts/colors.mk
Normal file
@@ -0,0 +1,115 @@
|
||||
# UnitForge Color Definitions for Makefiles
|
||||
# Centralized ANSI color codes for consistent terminal output in Make targets
|
||||
|
||||
# Basic colors
|
||||
BLUE := \033[0;34m
|
||||
GREEN := \033[0;32m
|
||||
YELLOW := \033[1;33m
|
||||
RED := \033[0;31m
|
||||
PURPLE := \033[0;35m
|
||||
CYAN := \033[0;36m
|
||||
WHITE := \033[0;37m
|
||||
GRAY := \033[0;90m
|
||||
|
||||
# Bright colors
|
||||
BRIGHT_RED := \033[1;31m
|
||||
BRIGHT_GREEN := \033[1;32m
|
||||
BRIGHT_YELLOW := \033[1;33m
|
||||
BRIGHT_BLUE := \033[1;34m
|
||||
BRIGHT_PURPLE := \033[1;35m
|
||||
BRIGHT_CYAN := \033[1;36m
|
||||
BRIGHT_WHITE := \033[1;37m
|
||||
|
||||
# Background colors
|
||||
BG_RED := \033[41m
|
||||
BG_GREEN := \033[42m
|
||||
BG_YELLOW := \033[43m
|
||||
BG_BLUE := \033[44m
|
||||
BG_PURPLE := \033[45m
|
||||
BG_CYAN := \033[46m
|
||||
BG_WHITE := \033[47m
|
||||
|
||||
# Text formatting
|
||||
BOLD := \033[1m
|
||||
DIM := \033[2m
|
||||
UNDERLINE := \033[4m
|
||||
REVERSE := \033[7m
|
||||
|
||||
# Reset
|
||||
NC := \033[0m
|
||||
RESET := \033[0m
|
||||
|
||||
# Status symbols
|
||||
INFO_SYMBOL := ℹ
|
||||
SUCCESS_SYMBOL := ✓
|
||||
WARNING_SYMBOL := ⚠
|
||||
ERROR_SYMBOL := ✗
|
||||
DEBUG_SYMBOL := 🐛
|
||||
|
||||
# Makefile utility functions (use with $(call function_name,message))
|
||||
define info
|
||||
@printf "$(BLUE)$(INFO_SYMBOL)$(NC) %s\n" "$(1)"
|
||||
endef
|
||||
|
||||
define success
|
||||
@printf "$(GREEN)$(SUCCESS_SYMBOL)$(NC) %s\n" "$(1)"
|
||||
endef
|
||||
|
||||
define warning
|
||||
@printf "$(YELLOW)$(WARNING_SYMBOL)$(NC) %s\n" "$(1)"
|
||||
endef
|
||||
|
||||
define error
|
||||
@printf "$(RED)$(ERROR_SYMBOL)$(NC) %s\n" "$(1)" >&2
|
||||
endef
|
||||
|
||||
define header
|
||||
@echo ""
|
||||
@printf "$(BOLD)$(BLUE)%s$(NC)\n" "$(1)"
|
||||
@printf "$(BLUE)%s$(NC)\n" "$$(printf '%.0s=' $$(seq 1 $$(printf '%s' '$(1)' | wc -c)))"
|
||||
endef
|
||||
|
||||
define subheader
|
||||
@echo ""
|
||||
@printf "$(BOLD)%s$(NC)\n" "$(1)"
|
||||
@printf "%s\n" "$$(printf '%.0s-' $$(seq 1 $$(printf '%s' '$(1)' | wc -c)))"
|
||||
endef
|
||||
|
||||
define step
|
||||
@printf "$(CYAN)[%s]$(NC) $(BOLD)%s$(NC)\n" "$(1)" "$(2)"
|
||||
endef
|
||||
|
||||
define status
|
||||
@case "$(1)" in \
|
||||
"ok"|"success"|"done") \
|
||||
printf "$(GREEN)[ OK ]$(NC) %s\n" "$(2)" ;; \
|
||||
"fail"|"error"|"failed") \
|
||||
printf "$(RED)[ FAIL ]$(NC) %s\n" "$(2)" ;; \
|
||||
"warn"|"warning") \
|
||||
printf "$(YELLOW)[ WARN ]$(NC) %s\n" "$(2)" ;; \
|
||||
"info") \
|
||||
printf "$(BLUE)[ INFO ]$(NC) %s\n" "$(2)" ;; \
|
||||
"skip"|"skipped") \
|
||||
printf "$(GRAY)[ SKIP ]$(NC) %s\n" "$(2)" ;; \
|
||||
*) \
|
||||
printf "$(WHITE)[ ]$(NC) %s\n" "$(2)" ;; \
|
||||
esac
|
||||
endef
|
||||
|
||||
# Box drawing
|
||||
define box_header
|
||||
@printf "$(BLUE)╔══════════════════════════════════════════════╗$(NC)\n"
|
||||
@printf "$(BLUE)║$(NC) %-44s $(BLUE)║$(NC)\n" "$(1)"
|
||||
@printf "$(BLUE)╚══════════════════════════════════════════════╝$(NC)\n"
|
||||
endef
|
||||
|
||||
# Usage examples:
|
||||
# $(call info,This is an info message)
|
||||
# $(call success,Operation completed successfully)
|
||||
# $(call warning,This is a warning)
|
||||
# $(call error,Something went wrong)
|
||||
# $(call header,Main Section)
|
||||
# $(call subheader,Subsection)
|
||||
# $(call box_header,UnitForge Setup)
|
||||
# $(call step,1/5,Installing dependencies)
|
||||
# $(call status,ok,Package installed)
|
||||
Reference in New Issue
Block a user