Skip to content
Closed
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
24 changes: 24 additions & 0 deletions packages/mix/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
## Unreleased

### Deprecations

- **`BorderStyleMixin` per-edge helpers:** `borderAll`, `borderTop`,
`borderBottom`, `borderLeft`, `borderRight`, `borderStart`, `borderEnd`,
`borderVertical` and `borderHorizontal` are deprecated. Each composes exactly
what `border` already expresses through `BoxBorderMix`, so the nine helpers
duplicated the property surface without adding capability:

```dart
// Before
BoxStyler().borderAll(color: Colors.blue, width: 1.5);
BoxStyler().borderTop(color: Colors.blue, width: 2);

// After
BoxStyler().border(.color(Colors.blue).width(1.5));
BoxStyler().border(.top(.color(Colors.blue).width(2)));
```

`BoxBorderMix.all()` is **not** deprecated. It is the only way to apply a
prebuilt `BorderSideMix` to every edge, it backs `BoxBorderMix.none`, and it
stays symmetric with `.top()`, `.bottom()`, `.left()` and `.right()`.

## 2.2.0-beta.5

### New features
Expand Down
36 changes: 36 additions & 0 deletions packages/mix/lib/src/style/mixins/border_style_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ mixin BorderStyleMixin<T extends Mix<Object?>>
implements DecorationStyleMixin<T> {
// Individual border side methods with full BorderSide property support
/// Sets the top border.
///
/// Prefer `.border(.top(.color(…).width(…)))`, which composes the same border through
/// [border] without a dedicated helper per edge.
@Deprecated('Use .border(.top(.color(…).width(…))) instead.')
T borderTop({
Color? color,
double? width,
Expand All @@ -28,6 +32,10 @@ mixin BorderStyleMixin<T extends Mix<Object?>>
}

/// Sets the bottom border.
///
/// Prefer `.border(.bottom(.color(…).width(…)))`, which composes the same border through
/// [border] without a dedicated helper per edge.
@Deprecated('Use .border(.bottom(.color(…).width(…))) instead.')
T borderBottom({
Color? color,
double? width,
Expand All @@ -47,6 +55,10 @@ mixin BorderStyleMixin<T extends Mix<Object?>>
}

/// Sets the left border.
///
/// Prefer `.border(.left(.color(…).width(…)))`, which composes the same border through
/// [border] without a dedicated helper per edge.
@Deprecated('Use .border(.left(.color(…).width(…))) instead.')
T borderLeft({
Color? color,
double? width,
Expand All @@ -66,6 +78,10 @@ mixin BorderStyleMixin<T extends Mix<Object?>>
}

/// Sets the right border.
///
/// Prefer `.border(.right(.color(…).width(…)))`, which composes the same border through
/// [border] without a dedicated helper per edge.
@Deprecated('Use .border(.right(.color(…).width(…))) instead.')
T borderRight({
Color? color,
double? width,
Expand All @@ -85,6 +101,10 @@ mixin BorderStyleMixin<T extends Mix<Object?>>
}

/// Sets the start border (RTL-aware).
///
/// Prefer `.border(.start(.color(…).width(…)))`, which composes the same border through
/// [border] without a dedicated helper per edge.
@Deprecated('Use .border(.start(.color(…).width(…))) instead.')
T borderStart({
Color? color,
double? width,
Expand All @@ -104,6 +124,10 @@ mixin BorderStyleMixin<T extends Mix<Object?>>
}

/// Sets the end border (RTL-aware).
///
/// Prefer `.border(.end(.color(…).width(…)))`, which composes the same border through
/// [border] without a dedicated helper per edge.
@Deprecated('Use .border(.end(.color(…).width(…))) instead.')
T borderEnd({
Color? color,
double? width,
Expand All @@ -123,6 +147,10 @@ mixin BorderStyleMixin<T extends Mix<Object?>>
}

/// Sets vertical borders (top & bottom).
///
/// Prefer `.border(.vertical(.color(…).width(…)))`, which composes the same border through
/// [border] without a dedicated helper per edge.
@Deprecated('Use .border(.vertical(.color(…).width(…))) instead.')
T borderVertical({
Color? color,
double? width,
Expand All @@ -140,6 +168,10 @@ mixin BorderStyleMixin<T extends Mix<Object?>>
}

/// Sets horizontal borders (left & right).
///
/// Prefer `.border(.horizontal(.color(…).width(…)))`, which composes the same border through
/// [border] without a dedicated helper per edge.
@Deprecated('Use .border(.horizontal(.color(…).width(…))) instead.')
T borderHorizontal({
Color? color,
double? width,
Expand All @@ -157,6 +189,10 @@ mixin BorderStyleMixin<T extends Mix<Object?>>
}

/// Sets all borders.
///
/// Prefer `.border(.color(…).width(…))`, which composes the same border through
/// [border] without a dedicated helper per edge.
@Deprecated('Use .border(.color(…).width(…)) instead.')
T borderAll({
Color? color,
double? width,
Expand Down
Loading