in2code-de / ipandlanguageredirect

TYPO3 redirect - browserlanguage and ip-address based
GNU General Public License v3.0
14 stars 14 forks source link

[TASK] Simplify customizations via CSS #35

Closed scheibome closed 2 years ago

scheibome commented 2 years ago

Until now you have to write several lines of CSS to change the background color, the link color and the spacing of the link. Now it is possible to customize these via CSS custom properties. At the same time I updated the NPM packages and brought the gulp tasks up to date.

Example with SCSS (Customize the background color and the text/link color):

Before

.ipandlanguageredirect {
  background-color: #FF0000;
  color: #FFFFFF;

  &__button {
    color: currentcolor;

    &:visited,
    &:hover,
    &:active {
      color: currentcolor;
    }
  }

  &__item {

    &--first {

      &::after {
        border-inline-end: 1px solid currentcolor;
      }
    }
  }
}

After:

:root {
  --ipandlanguageredirect-backgroundcolor: #FF9900;
  --ipandlanguageredirect-color: #FFFFFF;
}

Available CSS custom properties are:

--ipandlanguageredirect-backgroundcolor: #FF9900;
--ipandlanguageredirect-color: #FFFFFF;
--ipandlanguageredirect-innerspacing: 1rem;
--ipandlanguageredirect-maxheight: 300px;
--ipandlanguageredirect-buttonspacing: 0.5rem;

To test the changes:

cd /Resources/Private/Build npm i ./node_modules/.bin/gulp watchAll or ./node_modules/.bin/gulp buildAll

einpraegsam commented 2 years ago

Thx, I just merged the PR and will release a new minor version