Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 80 additions & 2 deletions fh_tailwindcss/utility/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
BorderStyle,
BorderWidth, BorderWidths,
DivideUtilities,
RingUtilities)
RingUtilities
)
from .layout import Display
from .sizing import Height, Width, Size, MaxWidth
from .spacing import Margin, Margins, Padding, Paddings
Expand All @@ -21,12 +22,89 @@
BackgroundImage,
GradientColorStop, GradientColorStops
)
from .effect import (
BackgroundBlendMode,
BoxShadowColor, BoxShadowColors,
BoxShadow,
MixBlendMode,
Opacity, Opacities
)

from .filter import (
Blur,
Brightness, Brightnesses,
Contrast, Contrasts,
DropShadow,
GrayScale,
HueRotate, HueRotateDegrees,
Invert,
Saturate, SaturateValues,
Sepia,
BackdropBlur,
BackdropBrightness, BackdropBrightnesses,
BackdropContrast, BackdropContrasts,
BackdropGrayScale,
BackdropHueRotate, BackdropHueRotateDegrees,
BackdropInvert,
BackdropOpacity, BackdropOpacities,
BackdropSaturate, BackdropSaturateValues,
BackdropSepia
)

from .accessibility import ForcedColorAdjust, ScreenReader

from .interactivity import (
AccentColor, AccentColors,
Appearance,
CaretColor, CaretColors,
Cursor,
PointerEvents,
Resize,
ScrollBehavior, ScrollMargin, ScrollMargins, ScrollPadding, ScrollPaddings, ScrollSnapAlign, ScrollSnapStop, ScrollSnapType,
TouchAction,
UserSelect,
WillChange
)

from .svg import Fill, Stroke, Strokes, StrokeWidth

from .table import (
BorderCollapse,
BorderSpacing, BorderSpacings,
CaptionSide,
TableLayout
)

from .transform import (
Rotate, RotateDegrees,
Scale, ScaleValues,
Skew, SkewDegrees,
TransformOrigin,
Translate, TranslateValues
)

from .transition_and_animation import (
Animation,
TransitionDelay, TransitionDelays,
TransitionDuration, TransitionDurations,
TransitionProperty,
TransitionTimingFunction
)

__all__ = [
'BackgroundAttachment', 'BackgroundClip', 'BackgroundColor', 'BackgroundColors', 'BackgroundOrigin', 'BackgroundPosition', 'BackgroundRepeat', 'BackgroundSize', 'BackgroundImage', 'GradientColorStop', 'GradientColorStops',
'BorderColor', 'BorderColors', 'BorderRadius', 'BorderStyle', 'BorderWidth', 'BorderWidths', 'DivideUtilities', 'RingUtilities',
'Display',
'Height', 'Width', 'Size', 'MaxWidth',
'Margin', 'Margins', 'Padding', 'Paddings',
'FontSize', 'FontWeight'
'FontSize', 'FontWeight',
'BackgroundBlendMode', 'BoxShadowColor', 'BoxShadowColors', 'BoxShadow', 'MixBlendMode', 'Opacity', 'Opacities',
'Blur', 'Brightness', 'Brightnesses', 'Contrast', 'Contrasts', 'DropShadow', 'GrayScale', 'HueRotate', 'HueRotateDegrees', 'Invert', 'Saturate', 'SaturateValues', 'Sepia',
'BackdropBlur', 'BackdropBrightness', 'BackdropBrightnesses', 'BackdropContrast', 'BackdropContrasts', 'BackdropGrayScale', 'BackdropHueRotate', 'BackdropHueRotateDegrees', 'BackdropInvert', 'BackdropOpacity', 'BackdropOpacities', 'BackdropSaturate', 'BackdropSaturateValues', 'BackdropSepia',
'ForcedColorAdjust', 'ScreenReader',
'AccentColor', 'AccentColors', 'Appearance', 'CaretColor', 'CaretColors', 'Cursor', 'PointerEvents', 'Resize', 'ScrollBehavior', 'ScrollMargin', 'ScrollMargins', 'ScrollPadding', 'ScrollPaddings', 'ScrollSnapAlign', 'ScrollSnapStop', 'ScrollSnapType', 'TouchAction', 'UserSelect', 'WillChange',
'Fill', 'Stroke', 'Strokes', 'StrokeWidth',
'BorderCollapse', 'BorderSpacing', 'BorderSpacings', 'CaptionSide', 'TableLayout',
'Rotate', 'RotateDegrees', 'Scale', 'ScaleValues', 'Skew', 'SkewDegrees', 'TransformOrigin', 'Translate', 'TranslateValues',
'Animation', 'TransitionDelay', 'TransitionDelays', 'TransitionDuration', 'TransitionDurations', 'TransitionProperty', 'TransitionTimingFunction'
]
7 changes: 7 additions & 0 deletions fh_tailwindcss/utility/accessibility/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from .forced_color_adjust import ForcedColorAdjust
from .screen_reader import ScreenReader

__all__ = [
"ForcedColorAdjust",
"ScreenReader",
]
15 changes: 15 additions & 0 deletions fh_tailwindcss/utility/accessibility/forced_color_adjust.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from ...tailwind import TailwindEnum

# https://tailwindcss.com/docs/forced-color-adjust

class ForcedColorAdjust(TailwindEnum):
"""
Utilities for opting in and out of forced colors.

Attributes:
AUTO (str): Represents `forced-color-adjust-auto` to allow forced color adjustment.
NONE (str): Represents `forced-color-adjust-none` to disable forced color adjustment.
"""

AUTO = "forced-color-adjust-auto"
NONE = "forced-color-adjust-none"
15 changes: 15 additions & 0 deletions fh_tailwindcss/utility/accessibility/screen_reader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from ...tailwind import TailwindEnum

# https://tailwindcss.com/docs/screen-readers

class ScreenReader(TailwindEnum):
"""
Utilities for improving accessibility with screen readers.

Attributes:
SR_ONLY (str): Represents `sr-only` for making an element visually hidden but accessible to screen readers.
NOT_SR_ONLY (str): Represents `not-sr-only` for making an element visible and accessible to both screen readers and users.
"""

SR_ONLY = "sr-only"
NOT_SR_ONLY = "not-sr-only"
13 changes: 13 additions & 0 deletions fh_tailwindcss/utility/effect/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from .background_blend_mode import BackgroundBlendMode
from .box_shadow_color import BoxShadowColor, BoxShadowColors
from .box_shadow import BoxShadow
from .mix_blend_mode import MixBlendMode
from .opacity import Opacity, Opacities

__all__ = [
'BackgroundBlendMode',
'BoxShadowColor', 'BoxShadowColors',
'BoxShadow',
'MixBlendMode',
'Opacity', 'Opacities'
]
41 changes: 41 additions & 0 deletions fh_tailwindcss/utility/effect/background_blend_mode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from ...tailwind import TailwindEnum

class BackgroundBlendMode(TailwindEnum):
"""
Utilities for controlling how an element's background image should blend with its background color.

Attributes:
NORMAL (str): Sets the background blend mode to normal.
MULTIPLY (str): Sets the background blend mode to multiply.
SCREEN (str): Sets the background blend mode to screen.
OVERLAY (str): Sets the background blend mode to overlay.
DARKEN (str): Sets the background blend mode to darken.
LIGHTEN (str): Sets the background blend mode to lighten.
COLOR_DODGE (str): Sets the background blend mode to color-dodge.
COLOR_BURN (str): Sets the background blend mode to color-burn.
HARD_LIGHT (str): Sets the background blend mode to hard-light.
SOFT_LIGHT (str): Sets the background blend mode to soft-light.
DIFFERENCE (str): Sets the background blend mode to difference.
EXCLUSION (str): Sets the background blend mode to exclusion.
HUE (str): Sets the background blend mode to hue.
SATURATION (str): Sets the background blend mode to saturation.
COLOR (str): Sets the background blend mode to color.
LUMINOSITY (str): Sets the background blend mode to luminosity.
"""

NORMAL = "bg-blend-normal"
MULTIPLY = "bg-blend-multiply"
SCREEN = "bg-blend-screen"
OVERLAY = "bg-blend-overlay"
DARKEN = "bg-blend-darken"
LIGHTEN = "bg-blend-lighten"
COLOR_DODGE = "bg-blend-color-dodge"
COLOR_BURN = "bg-blend-color-burn"
HARD_LIGHT = "bg-blend-hard-light"
SOFT_LIGHT = "bg-blend-soft-light"
DIFFERENCE = "bg-blend-difference"
EXCLUSION = "bg-blend-exclusion"
HUE = "bg-blend-hue"
SATURATION = "bg-blend-saturation"
COLOR = "bg-blend-color"
LUMINOSITY = "bg-blend-luminosity"
41 changes: 41 additions & 0 deletions fh_tailwindcss/utility/effect/box_shadow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from ...tailwind import TailwindEnum

# https://tailwindcss.com/docs/box-shadow

class BoxShadow(TailwindEnum):
"""
Utilities for controlling the box shadow of an element.

Attributes:
SM (str): A small shadow for minimal emphasis.
Equivalent to `box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);`.

DEFAULT (str): The default shadow providing balanced depth.
Equivalent to `box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);`.

MD (str): A medium shadow suitable for moderate emphasis.
Equivalent to `box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);`.

LG (str): A large shadow for elements requiring higher prominence.
Equivalent to `box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);`.

XL (str): An extra-large shadow for significant emphasis.
Equivalent to `box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);`.

XXL (str): A prominent shadow with greater spread and softness.
Equivalent to `box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);`.

INNER (str): An inner shadow for inset effects.
Equivalent to `box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);`.

NONE (str): Removes any applied shadow.
Equivalent to `box-shadow: 0 0 #0000;`.
"""
SM = "shadow-sm"
DEFAULT = "shadow"
MD = "shadow-md"
LG = "shadow-lg"
XL = "shadow-xl"
XXL = "shadow-2xl"
INNER = "shadow-inner"
NONE = "shadow-none"
69 changes: 69 additions & 0 deletions fh_tailwindcss/utility/effect/box_shadow_color.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
from ...tailwind import TailwindDict, TailwindEnum

# https://tailwindcss.com/docs/box-shadow-color

class BoxShadowColor(TailwindEnum):
"""
Utilities for controlling the color of a box shadow.

Attributes:
INHERIT (str): Inherits the box shadow color.
CURRENT (str): Sets the box shadow color to the current text color.
TRANSPARENT (str): Makes the box shadow color transparent.
BLACK (str): A solid black box shadow color.
WHITE (str): A solid white box shadow color.
SLATE (str): Shades of slate colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
GRAY (str): Shades of gray colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
ZINC (str): Shades of zinc colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
NEUTRAL (str): Shades of neutral colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
STONE (str): Shades of stone colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
RED (str): Shades of red colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
ORANGE (str): Shades of orange colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
AMBER (str): Shades of amber colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
YELLOW (str): Shades of yellow colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
LIME (str): Shades of lime colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
GREEN (str): Shades of green colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
EMERALD (str): Shades of emerald colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
TEAL (str): Shades of teal colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
CYAN (str): Shades of cyan colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
SKY (str): Shades of sky colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
BLUE (str): Shades of blue colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
INDIGO (str): Shades of indigo colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
VIOLET (str): Shades of violet colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
PURPLE (str): Shades of purple colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
FUCHSIA (str): Shades of fuchsia colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
PINK (str): Shades of pink colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
ROSE (str): Shades of rose colors. Available options: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950].
"""

INHERIT = "shadow-inherit"
CURRENT = "shadow-current"
TRANSPARENT = "shadow-transparent"
BLACK = "shadow-black"
WHITE = "shadow-white"

SLATE = "shadow-slate"
GRAY = "shadow-gray"
ZINC = "shadow-zinc"
NEUTRAL = "shadow-neutral"
STONE = "shadow-stone"
RED = "shadow-red"
ORANGE = "shadow-orange"
AMBER = "shadow-amber"
YELLOW = "shadow-yellow"
LIME = "shadow-lime"
GREEN = "shadow-green"
EMERALD = "shadow-emerald"
TEAL = "shadow-teal"
CYAN = "shadow-cyan"
SKY = "shadow-sky"
BLUE = "shadow-blue"
INDIGO = "shadow-indigo"
VIOLET = "shadow-violet"
PURPLE = "shadow-purple"
FUCHSIA = "shadow-fuchsia"
PINK = "shadow-pink"
ROSE = "shadow-rose"

class BoxShadowColors(TailwindDict):
pass
47 changes: 47 additions & 0 deletions fh_tailwindcss/utility/effect/mix_blend_mode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from ...tailwind import TailwindEnum

# https://tailwindcss.com/docs/mix-blend-mode

class MixBlendMode(TailwindEnum):
"""
Utilities for controlling how an element should blend with the background.

Attributes:
NORMAL (str): Sets the blend mode to normal.
MULTIPLY (str): Sets the blend mode to multiply.
SCREEN (str): Sets the blend mode to screen.
OVERLAY (str): Sets the blend mode to overlay.
DARKEN (str): Sets the blend mode to darken.
LIGHTEN (str): Sets the blend mode to lighten.
COLOR_DODGE (str): Sets the blend mode to color-dodge.
COLOR_BURN (str): Sets the blend mode to color-burn.
HARD_LIGHT (str): Sets the blend mode to hard-light.
SOFT_LIGHT (str): Sets the blend mode to soft-light.
DIFFERENCE (str): Sets the blend mode to difference.
EXCLUSION (str): Sets the blend mode to exclusion.
HUE (str): Sets the blend mode to hue.
SATURATION (str): Sets the blend mode to saturation.
COLOR (str): Sets the blend mode to color.
LUMINOSITY (str): Sets the blend mode to luminosity.
PLUS_DARKER (str): Sets the blend mode to plus-darker.
PLUS_LIGHTER (str): Sets the blend mode to plus-lighter.
"""

NORMAL = "mix-blend-normal"
MULTIPLY = "mix-blend-multiply"
SCREEN = "mix-blend-screen"
OVERLAY = "mix-blend-overlay"
DARKEN = "mix-blend-darken"
LIGHTEN = "mix-blend-lighten"
COLOR_DODGE = "mix-blend-color-dodge"
COLOR_BURN = "mix-blend-color-burn"
HARD_LIGHT = "mix-blend-hard-light"
SOFT_LIGHT = "mix-blend-soft-light"
DIFFERENCE = "mix-blend-difference"
EXCLUSION = "mix-blend-exclusion"
HUE = "mix-blend-hue"
SATURATION = "mix-blend-saturation"
COLOR = "mix-blend-color"
LUMINOSITY = "mix-blend-luminosity"
PLUS_DARKER = "mix-blend-plus-darker"
PLUS_LIGHTER = "mix-blend-plus-lighter"
17 changes: 17 additions & 0 deletions fh_tailwindcss/utility/effect/opacity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from ...tailwind import TailwindDict, TailwindEnum

# https://tailwindcss.com/docs/opacity

class Opacity(TailwindEnum):
"""
Utilities for controlling the opacity of an element.

Attributes:
OPACITY (str): Base class for opacity utilities. Available intensity values:
[0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100].
"""

OPACITY = "opacity"

class Opacities(TailwindDict):
pass
Loading