hextra icon indicating copy to clipboard operation
hextra copied to clipboard

Option to gloablly unset/set rounded corners

Open SammyJenas opened this issue 11 months ago • 5 comments

Feature Description

It would be great if rounded corners could be globally unset/set, to change the look of code blocks, cards, etc.

Solution

Perhaps an option could be added using the theme setting in the hugo.yaml file? Not sure if that's possible or the way to do it though...

SammyJenas avatar Jan 19 '25 20:01 SammyJenas

For further customization, feel free to utilize custom CSS. You can find a detailed guide here: Customizing Hextra.

imfing avatar Jan 19 '25 20:01 imfing

in the meantime, it might be a good idea to provide a global CSS variable that allows us to override the border radius.

imfing avatar Jan 19 '25 20:01 imfing

in the meantime, it might be a good idea to provide a global CSS variable that allows us to override the border radius.

This is what I was thinking would be useful, yes.

Is it as simple as adding a variable to set this:

* {
  border-radius: 0;
}

SammyJenas avatar Jan 19 '25 22:01 SammyJenas

Is this feature pull request also related? Something about adding custom utility classes in tailwind config (sorry, I'm not familiar with how CSS and tailwind work)

SammyJenas avatar Jan 19 '25 23:01 SammyJenas

Is this feature pull request also related? Something about adding custom utility classes in tailwind config (sorry, I'm not familiar with how CSS and tailwind work)

kinda related, that one was about customizing the colors. Similarly we can do so for corner radius

imfing avatar Jan 21 '25 00:01 imfing

You are now able to customize the css variables, for example

@layer theme {
  :root {
    --hx-radius-xs: 0;
    --hx-radius-sm: 0;
    --hx-radius-md: 0;
    --hx-radius-lg: 0;
    --hx-radius-xl: 0;
    --hx-radius-2xl: 0;
    --hx-radius-3xl: 0;
  }
}
Image

Caveat: rounded-full can't be adjusted via css variables

imfing avatar Aug 27 '25 19:08 imfing