riccardoperra / codeimage

A tool to beautify your code screenshots. Built with SolidJS and Fastify.
https://codeimage.dev
MIT License
1.43k stars 75 forks source link

šŸš€ - Allow padding to be Zero #623

Closed SarjuHansaliya closed 6 months ago

SarjuHansaliya commented 10 months ago

Which @codeimage/* package(s) are relevant/releated to the feature request?

ui

Description

Currently padding options are 16, 32, 64, 128.

It would be great if it allow 0 option also.

If you think this is helpful, I can work on creating PR.

riccardoperra commented 10 months ago

Hi, yes this could be helpful šŸ™‚

In my opinion the segmentedControl cannot be used anymore since there is no enough space for five items. Instead, we should use the Select control.

Anyway, some info for the pr since navigating into the codebase could be painful:

Hereā€™s the configuration file with the padding settings configuration.ts

Iā€™d recommend you to refactor the current number[] array to a key-value object with label and value property, just like the ā€œeditorRadiusā€ config.

The editor ui for padding is here: FrameStyleForm

You can copy a select implementation from this:

https://github.com/riccardoperra/codeimage/blob/d3bcdacda3cd707500463ff0e4e2e5587584cacb/apps/codeimage/src/components/PropertyEditor/EditorStyleForm.tsx#L47-L56

https://github.com/riccardoperra/codeimage/blob/d3bcdacda3cd707500463ff0e4e2e5587584cacb/apps/codeimage/src/components/PropertyEditor/EditorStyleForm.tsx#L106-L120

Note: currently the radius between the frame and the editor could be different, then the editor frame border radius must be 0 when frame padding = 0

I think you can update here the ā€œstyles.terminalVars.radiusā€ css variable

https://github.com/riccardoperra/codeimage/blob/d3bcdacda3cd707500463ff0e4e2e5587584cacb/apps/codeimage/src/components/Terminal/TerminalHost.tsx#L54-L66

SarjuHansaliya commented 10 months ago

awesome @riccardoperra thank you for the information, let me work on it.

riccardoperra commented 10 months ago

Thanks for your collaboration šŸ˜ƒ use the contributions.md to startup the project but if you need something, just ask.

if you donā€™t want to run docker etc because you donā€™t need the backend for this change, I think you will have to run the build command manually for each package in ā€œpackagesā€ folder, except ā€œapi-typesā€ (which requires you to have a backend with Postgres up)

SarjuHansaliya commented 10 months ago

@riccardoperra I have created PR here https://github.com/riccardoperra/codeimage/pull/625

stale[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

riccardoperra commented 6 months ago

625 to be merged

riccardoperra commented 6 months ago

Released with 1.6.0. Thanks for your contribution :)

SarjuHansaliya commented 6 months ago

Awesome @riccardoperra Thanks for publishing those changes