„Klaro [klɛro] is a simple consent management platform (CMP) and privacy tool that helps you to be transparent about the third-party applications on your website. It is designed to be extremely simple, intuitive and easy to use while allowing you to be compliant with all relevant regulations (notably GDPR and ePrivacy).“
The tool is developed by KIPROTECT and can be found on Github.
As I integrated Klaro on a couple of websites so far, I decided to make my work a bit easier and start building some basic clean themes for it.
I have a basic white and black&white theme so far. The download includes a testdrive folder, to showcase the themes. The white theme is also used on this website ;)
I really hate those standard consent management modals, that integrate badly into the website native design.
Klaro does a good job allowing to override its core theme and makes it a bit more pleasant. We do have to live with those modals from now on ;)
The themes are Sass-based and provide easy configuration options.
Enjoy!
cubicFUSION Themes for Klaro! @ Github
Klaro is still missing some things, will collect some workarounds here for you to play with.
Updates: Github Discussion
– 0.7.10 also adds custom callbacks to services (onAccept, onDecline, onInit) NICE!
Used a simple MutationObserver to do some magic for now, without diving into the core Klaro code for now. I am sure they already have an event listener or watcher setup.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
var cm_event = document.createEvent('Event'); cm_event.initEvent('consentModalOpen', true, true); document.addEventListener('consentModalOpen', function (e) { console.log("consentModalOpen") }, false); document.addEventListener("DOMContentLoaded", function(e) { var cm_target = document.getElementById( "klaro" ), cm_visible = false; var observer = new MutationObserver(function(mutationRecords) { if(document.querySelectorAll('#klaro .cookie-modal').length > 0 && cm_visible == false){ cm_visible = true; document.dispatchEvent(cm_event); }else{ cm_visible = false; } }); observer.observe(cm_target, { childList: true, subtree: true, characterDataOldValue: true }); }); |
A nice set of CSS3 Animations that can be easily used to spice up your design.
The animations can be triggered through Javascript, jQuery and the timings can be tweaked through pure CSS. The package also provides gulp, so that you can tweak every aspect easily.
Two tools that can enhance your workflow immensely. Enjoy!
„Element queries are a new way of thinking about responsive web design where the responsive conditions apply to elements on the page instead of the width or height of the browser.
Unlike CSS @media queries, @element Queries are aware of more than just the width and height of the browser, you can write responsive conditions for a number of different situations like how many characters of text or child elements an element contains.
Another concept that element queries brings to CSS is the idea of ‘scoping’ your styles to one element in the same way that JavaScript functions define a new scope for the variables they contain.“
min-width
min-width in px, min-width in %max-width
max-width in px, max-width in %min-height
min-height in px, min-height in %max-height
max-height in px, max-height in %min-characters
on block elements, on form inputsmax-characters
on block elements, on form inputsmin-lines
min-lines demomax-lines
max-lines demomin-children
min-children demomax-children
max-children demomin-scroll-y
min-scroll-y demomax-scroll-y
max-scroll-y demomin-scroll-x
min-scroll-x demomax-scroll-x
max-scroll-x demoorientation
orientation demomin-aspect-ratio
min-aspect-ratio demomax-aspect-ratio
max-aspect-ratio demo$this
$this demo$parent
$parent demo$root
$root demo$prev
$prev demo$next
$next demo„Koala is a GUI application for Less, Sass, Compass and CoffeeScript compilation, to help web developers to use them more efficiently. Koala can run in windows, linux and mac.“
I almost completely switched to Sass in the past year. So organzing my CSS code has become a mission of mine :)
Structure is especially needed, when you are not the only one working on the design. So that everyone on the team can easily understand and contribute with ease. There are never too many files, as files get combined anyway.
Make your own life easier and for those you work with!
Currently applying the following structure on newer projects:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
sass/ | |– base/ | |– _reset.scss # Reset/normalize | |– _typography.scss # Typography rules | ... # etc… | |– components/ | |– _buttons.scss # Buttons | |– _carousel.scss # Carousel | |– _images.scss # Images | |– _dropdown.scss # Dropdown | |– _navigation.scss # Navigation | ... # etc… | |– utils/ | |– _variables.scss # Sass Variables | |– _functions.scss # Sass Functions | |– _mixins.scss # Sass Mixins | |– _utils.scss # Class & placeholders helpers | ... # etc… | |– layout/ | |– _grid.scss # Grid system | |– _header.scss # Header | |– _footer.scss # Footer | |– _sidebar.scss # Sidebar | |– _forms.scss # Forms | ... # etc… | |– sections/ | |– _home.scss # Home specific styles | |– _about_us.scss # About us specific styles | ... # etc… | |– themes/ | |– _front_base.scss # Parent theme | |– _front_child.scss # Child theme | |– _admin.scss # Admin theme | ... # etc… | |– vendors/ | |– _bootstrap.scss # Bootstrap | |– _bourbon.scss # Bourbon Mixins | ... # etc… | | `– app.scss # primary Sass file |
Which architecture fits your project & team will vary.
1 2 3 4 5 6 7 8 9 10 |
@mixin clearfix() { &:before, &:after { content: ""; display: table; } &:after { clear: both; } } |
1 2 3 |
.article { @include clearfix(); } |
Simple is king :)
CSS Crush is a standards inspired CSS pre-processor that is written in PHP from scratch.
For a current project I am adding CSS Crush side by side to Sass. Lets see which of them sticks around in the end :) Might be keeping them both, as CSS Crush provides some nice options.