Skip to content

Commit dc3ba8e

Browse files
Merge pull request #95 from whitecube/update-readme
Added more informations on button customization
2 parents 212ebac + b5c5340 commit dc3ba8e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,29 @@ As you probably noticed, we've included our design's CSS directly in the `cookie
370370

371371
Our CSS is compiled from a SASS file included in this package's `resources/scss` directory. If that fits your workflow, feel free to use it as a starting point for your own implementation.
372372

373+
Buttons in this package are designed to be easily customizable.
374+
You can pass an array of attributes directly to the `@cookieconsentbutton` component:
375+
376+
```blade
377+
@cookieconsentbutton(
378+
action: 'reset',
379+
label: 'Manage cookies',
380+
attributes: [
381+
'id' => 'reset-button',
382+
'class' => 'btn'
383+
]
384+
)
385+
```
386+
387+
In this example:
388+
389+
* The wrapping `<form>` element will receive the `btn` class.
390+
* The generated `<button>` itself will always have the `__link` added to the form class.
391+
392+
With this setup, you can freely customize your button styles using pseudo-classes like `:hover`, `:focus`, while keeping a clean and maintainable structure.
393+
394+
For other changes, don't forget [you can publish the package views](#the-views).
395+
373396
### Javascript
374397

375398
Keep in mind that cookie notices are supposed to work when Javascript is disabled. This package's base design only uses Javascript as an extra layer for a smoother User Experience, but its features do not rely on it.

0 commit comments

Comments
 (0)