Fixed the Margin-shorthand property #544
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Similar to font shorthand, the margin shorthand was being overwritten by default input of specific margin properties. This PR addresses this issue by implementing the following improvements:
Fixing the Margin Shorthand Property: The margin shorthand property is fixed by directly mapping it with specific margin properties in Lacci. This means that the margin shorthand will no longer write to the margin property. Instead, it will be split into four parts and sent to the specific margin properties.
Consistent Input Pattern: The margin shorthand now follows the same input pattern as the original Shoes library, which is
[left, top, right, bottom]
.Enhanced Flexibility: More types of input are now supported, including strings. Additionally, users can now provide only two or three entries to the margin, such as
[20, 30]
, which increases the flexibility of user input.Documentation Update: The manual.md file is updated to reflect the changes in the Margin Shorthand Property.
Test Coverage: Tests are added for the margin_parse method, which handles the mapping of the margin shorthand to specific properties.
Removal of 'Pacifico' Font: The 'Pacifico' font is removed from the example font_family.rb. This font was causing path mismatch issues whenever fixtures were generated and then GitHub CI tests were failing. Until the issue is fixed, its removal helps avoid confusion for newcomers.
Example Illustration: An example is provided to demonstrate how the margin shorthand works now.
Image(if needed, helps for a faster review)
Checklist