Skip to content

Comments

Added matrix function closes #8236#8249

Open
abdultalha0862 wants to merge 7 commits intoCodecademy:mainfrom
abdultalha0862:add-matrix-function
Open

Added matrix function closes #8236#8249
abdultalha0862 wants to merge 7 commits intoCodecademy:mainfrom
abdultalha0862:add-matrix-function

Conversation

@abdultalha0862
Copy link

Description

Added CSS matrix() Transform Function Documentation

Issue Solved

#8236

Type of Change

  • Adding a new entry

Checklist

  • All writings are my own.
  • My entry follows the Codecademy Docs style guide.
  • My changes generate no new warnings.
  • I have performed a self-review of my own writing and code.
  • I have checked my entry and corrected any misspellings.
  • I have made corresponding changes to the documentation if needed.
  • I have confirmed my changes are not being pushed from my forked main branch.
  • I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • I have linked any issues that are relevant to this PR in the Issues Solved section.

Copilot AI review requested due to automatic review settings February 22, 2026 10:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Codecademy Docs term entry documenting the CSS matrix() transform function (issue #8236), including illustrative images for the examples.

Changes:

  • Added a new term entry at content/css/concepts/transform-functions/terms/matrix/matrix.md.
  • Added three example output images under media/ and referenced them from the entry.

Reviewed changes

Copilot reviewed 1 out of 4 changed files in this pull request and generated 2 comments.

File Description
content/css/concepts/transform-functions/terms/matrix/matrix.md New documentation page for CSS matrix() including syntax, parameters, and examples with images.
media/matrix-example-1.png Output image for Example 1 (translation).
media/matrix-example-2.png Output image for Example 2 (scaling).
media/matrix-example-3.png Output image for Example 3 (combined transform).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


The CSS `matrix()` function uses a 2D matrix to scale, rotate, skew, and move an element. This combined setup puts multiple changes into one step and is commonly used in detailed animations[(https://www.codecademy.com/resources/docs/css/animations)], exact placement, or creative web layouts.

## CSS `matrix()` Syntax
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For term entries, the style guide/template expects the syntax section header to be exactly ## Syntax. Using a different header (e.g., ## CSS matrix() Syntax) can make the structure less consistent across entries and tooling that looks for standard sections.

Suggested change
## CSS `matrix()` Syntax
## Syntax

Copilot uses AI. Check for mistakes.
@abdultalha0862
Copy link
Author

@mamtawardhani I have submitted the issue #8236. Ready for the review

Please let me know if there are any changes

@abdultalha0862
Copy link
Author

@mamtawardhani

In line 19 Copilot suggested this change ## CSS matrix() Syntax to ## Syntax

but in the Official Docs we need to follow this format ## CSS matrix() Syntax

Which one should I follow?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


Here is the output:

![Matrix scaling example](https://raw.githubusercontent.com/Codecademy/docs/main/media/matrix-example-2.png)
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The image alt text could be more descriptive to better match the pattern used in other transform function entries. Consider using something like "A medium sea green colored box scaled to 1.5 times horizontally and 2 times vertically using the CSS matrix() function" to provide more context for accessibility.

Suggested change
![Matrix scaling example](https://raw.githubusercontent.com/Codecademy/docs/main/media/matrix-example-2.png)
![A medium sea green colored box scaled to 1.5 times horizontally and 2 times vertically using the CSS matrix() function](https://raw.githubusercontent.com/Codecademy/docs/main/media/matrix-example-2.png)

Copilot uses AI. Check for mistakes.

Here is the output:

![Matrix combined transformation example](https://raw.githubusercontent.com/Codecademy/docs/main/media/matrix-example-3.png)
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The image alt text could be more descriptive to better match the pattern used in other transform function entries. Consider using something like "A steel blue colored box with combined scaling, skewing, and translation applied using the CSS matrix() function" to provide more context for accessibility.

Suggested change
![Matrix combined transformation example](https://raw.githubusercontent.com/Codecademy/docs/main/media/matrix-example-3.png)
![A steel blue colored box with combined scaling, skewing, and translation applied using the CSS matrix() function](https://raw.githubusercontent.com/Codecademy/docs/main/media/matrix-example-3.png)

Copilot uses AI. Check for mistakes.

Here is the output:

![Matrix translation example](https://raw.githubusercontent.com/Codecademy/docs/main/media/matrix-example-1.png)
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The image alt text could be more descriptive to better match the pattern used in other transform function entries. For example, rotate.md uses "The CSS rotate() function rotates a box 45 degrees clockwise from its original position, creating a diamond-like appearance". Consider using something like "A coral colored box translated 100 pixels to the right and 100 pixels down using the CSS matrix() function" to provide more context for accessibility.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 34 to 36
## Example 1: Basic Translation in CSS Using `matrix()`

In this example, the `.box` element is moved `100px` to the right and `100px` down using CSS `matrix()`, demonstrating how the `e` and `f` parameters control horizontal and vertical translation:
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These example headers exceed the style guide recommendation that headers not exceed 5 words (and many existing transform-function terms use short headers like ## Example 1). Consider shortening these to ## Example 1, ## Example 2, etc., and moving the descriptive text into the paragraph body (or into ### subheaders).

Copilot uses AI. Check for mistakes.

![A coral colored box translated 100 pixels to the right and 100 pixels down using the CSS matrix() function](https://raw.githubusercontent.com/Codecademy/docs/main/media/matrix-example-1.png)

## Example 2: Scaling Elements in CSS Using `matrix()`
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same header-length issue as above: this header is longer than the style guide’s recommended maximum (5 words). Please shorten it for consistency/readability.

Copilot uses AI. Check for mistakes.

![A medium sea green colored box scaled to 1.5 times its original width and 2 times its original height using the CSS matrix() function](https://raw.githubusercontent.com/Codecademy/docs/main/media/matrix-example-2.png)

## Example 3: Combined Transformation in CSS With the Help of `matrix()`
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same header-length issue as above: this header is longer than the style guide’s recommended maximum (5 words). Please shorten it for consistency/readability.

Suggested change
## Example 3: Combined Transformation in CSS With the Help of `matrix()`
## Example 3: Combined matrix() transform

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mamtawardhani mamtawardhani self-assigned this Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants