Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate 3 overloads of StyleScope.borderWidth with wrong parameter names #2297

Merged
merged 5 commits into from
Sep 8, 2022
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -83,26 +83,115 @@ fun StyleScope.borderWidth(width: CSSNumeric) {
property("border-width", width)
}


/**
* https://developer.mozilla.org/en-US/docs/Web/CSS/border-width
*
* First argument sets the vertical borders width.
* Second argument sets the horizontal borders width.
*
* NOTE: Temporary deprecation until 2.0 because of wrong parameters names.
eymar marked this conversation as resolved.
Show resolved Hide resolved
* In 2.0 the parameter names should be fixed. Despite the wrong parameter names, the function behaves correctly.
*/
@Deprecated(
message = "This function has misleading parameter names. " +
"Despite that, it behaves correctly (see https://developer.mozilla.org/en-US/docs/Web/CSS/border-width)." +
"Therefore this function still can be used without specifying parameter names. Replacement is not necessary." +
" It'll remain Deprecated until 2.0, and in 2.0 parameter names should be changed to: " +
"`vertical: CSSNumeric` and `horizontal: CSSNumeric`",
replaceWith = ReplaceWith(
expression = "borderWidth2(vertical = topLeft, horizontal = bottomRight)"
)
)
fun StyleScope.borderWidth(topLeft: CSSNumeric, bottomRight: CSSNumeric) {
property("border-width", "$topLeft $bottomRight")
borderWidth2(topLeft, bottomRight)
}

/**
* This function is a temporary replacement for `borderWidth(topLeft: CSSNumeric, bottomRight: CSSNumeric)`.
* After a fix for parameters names in `borderWidth`,
* this function will be Deprecated with a replaceWith `borderWidth`. Later `borderWidth2` will be Removed.
* @see borderWidth
*/
fun StyleScope.borderWidth2(vertical: CSSNumeric, horizontal: CSSNumeric) {
property("border-width", "$vertical $horizontal")
}


/**
* https://developer.mozilla.org/en-US/docs/Web/CSS/border-width
*
* First argument sets the top border width.
* Second argument sets the horizontal borders width.
* Third argument sets the bottom border width.
*
* NOTE: Temporary deprecation until 2.0 because of wrong parameters names.
* In 2.0 the parameter names should be fixed. Despite the wrong parameter names, the function behaves correctly.
*/
@Deprecated(
message = "This function has misleading parameter names. " +
"Despite that, it behaves correctly (see https://developer.mozilla.org/en-US/docs/Web/CSS/border-width)." +
"Therefore this function still can be used without specifying parameter names. Replacement is not necessary." +
igordmn marked this conversation as resolved.
Show resolved Hide resolved
" It'll remain Deprecated until 2.0, and in 2.0 parameter names should be changed to: " +
"`top: CSSNumeric`, `horizontal: CSSNumeric`, `bottom: CSSNumeric`",
replaceWith = ReplaceWith(
expression = "borderWidth3(top = topLeft, horizontal = topRightAndBottomLeft, bottom = bottomRight)"
)
)
fun StyleScope.borderWidth(
topLeft: CSSNumeric,
topRightAndBottomLeft: CSSNumeric,
bottomRight: CSSNumeric
) {
property("border-width", "$topLeft $topRightAndBottomLeft $bottomRight")
borderWidth3(topLeft, topRightAndBottomLeft, bottomRight)
}

/**
* This function is a temporary replacement for `borderWidth(topLeft: CSSNumeric, topRightAndBottomLeft: CSSNumeric, bottomRight: CSSNumeric)`.
* After a fix for parameters names in `borderWidth`,
* this function will be Deprecated with a replaceWith `borderWidth`. Later `borderWidth3` will be Removed.
* @see borderWidth
*/
fun StyleScope.borderWidth3(top: CSSNumeric, horizontal: CSSNumeric, bottom: CSSNumeric) {
eymar marked this conversation as resolved.
Show resolved Hide resolved
property("border-width", "$top $horizontal $bottom")
}

/**
* https://developer.mozilla.org/en-US/docs/Web/CSS/border-width
*
* First argument sets the top border width.
* Second argument sets the right border width.
* Third argument sets the bottom border width.
* Fourth argument sets the left border width.
*
* NOTE: Temporary deprecation until 2.0 because of wrong parameters names.
* In 2.0 the parameter names should be fixed. Despite the wrong parameter names, the function behaves correctly.
*/
@Deprecated(
message = "This function has misleading parameter names. " +
"Despite that, it behaves correctly (see https://developer.mozilla.org/en-US/docs/Web/CSS/border-width)." +
"Therefore this function still can be used without specifying parameter names. Replacement is not necessary." +
" It'll remain Deprecated until 2.0, and in 2.0 parameter names should be changed to: " +
"`top: CSSNumeric`, `right: CSSNumeric`, `bottom: CSSNumeric`, `left: CSSNumeric`",
replaceWith = ReplaceWith(
expression = "borderWidth4(top = topLeft, right = topRight, bottom = bottomRight, left = bottomLeft)"
)
)
fun StyleScope.borderWidth(
topLeft: CSSNumeric,
topRight: CSSNumeric,
bottomRight: CSSNumeric,
bottomLeft: CSSNumeric
) {
property(
"border-width",
"$topLeft $topRight $bottomRight $bottomLeft"
)
borderWidth4(topLeft, topRight, bottomRight, bottomLeft)
}

/**
* This function is a temporary replacement for `borderWidth(topLeft: CSSNumeric, topRight: CSSNumeric, bottomRight: CSSNumeric, bottomLeft: CSSNumeric)`.
* After a fix for parameters names in `borderWidth`,
* this function will be Deprecated with a replaceWith `borderWidth`. Later `borderWidth4` will be Removed.
* @see borderWidth
*/
fun StyleScope.borderWidth4(top: CSSNumeric, right: CSSNumeric, bottom: CSSNumeric, left: CSSNumeric) {
property("border-width", "$top $right $bottom $left")
}