@qhealth-design-system/core 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +15 -0
- package/.browserslistrc +5 -0
- package/.editorconfig +19 -0
- package/.eslintignore +1 -0
- package/.eslintrc +25 -0
- package/.gitattributes +2 -0
- package/.github/workflows/release_package.yml +103 -0
- package/CHANGELOG.md +14 -0
- package/README.md +534 -0
- package/dist/api/service_finder/schemas.json +1 -0
- package/dist/component-abstract.html +884 -0
- package/dist/component-accordion.html +1157 -0
- package/dist/component-banner.html +928 -0
- package/dist/component-banner_advanced.html +1524 -0
- package/dist/component-banner_basic.html +1189 -0
- package/dist/component-banner_intermediate.html +1288 -0
- package/dist/component-body.html +919 -0
- package/dist/component-breadcrumbs.html +881 -0
- package/dist/component-btn.html +829 -0
- package/dist/component-callout.html +964 -0
- package/dist/component-card_feature.html +1805 -0
- package/dist/component-card_multi_action.html +1965 -0
- package/dist/component-card_no_action.html +1632 -0
- package/dist/component-card_single_action.html +1772 -0
- package/dist/component-code.html +928 -0
- package/dist/component-footer.html +1131 -0
- package/dist/component-forms.html +1297 -0
- package/dist/component-global-elements.html +1243 -0
- package/dist/component-global_alert.html +891 -0
- package/dist/component-header.html +1155 -0
- package/dist/component-in_page_navigation.html +920 -0
- package/dist/component-internal_navigation.html +1097 -0
- package/dist/component-left_hand_navigation.html +995 -0
- package/dist/component-main_navigation.html +999 -0
- package/dist/component-mega_main_navigation.html +1145 -0
- package/dist/component-multi_column.html +1116 -0
- package/dist/component-page_alert.html +911 -0
- package/dist/component-pagination.html +971 -0
- package/dist/component-tag_list.html +979 -0
- package/dist/component-updated_date.html +778 -0
- package/dist/component-widgets.html +851 -0
- package/dist/components/_global/import.xml +95 -0
- package/dist/components/_global/manifest.json +11 -0
- package/dist/components/_global/presentation.js +50 -0
- package/dist/components/_global/static.html +30 -0
- package/dist/components/_template/import.xml +299 -0
- package/dist/components/_template/manifest.json +40 -0
- package/dist/components/_template/presentation.js +12 -0
- package/dist/components/_template/static.html +4 -0
- package/dist/components/abstract/import.xml +231 -0
- package/dist/components/abstract/manifest.json +29 -0
- package/dist/components/abstract/presentation.js +33 -0
- package/dist/components/abstract/static.html +9 -0
- package/dist/components/accordion/import.xml +1929 -0
- package/dist/components/accordion/manifest.json +427 -0
- package/dist/components/accordion/presentation.js +112 -0
- package/dist/components/accordion/static.html +56 -0
- package/dist/components/banner/import.xml +95 -0
- package/dist/components/banner/manifest.json +11 -0
- package/dist/components/banner/presentation.js +138 -0
- package/dist/components/banner/static.html +39 -0
- package/dist/components/banner_advanced/import.xml +1969 -0
- package/dist/components/banner_advanced/manifest.json +1450 -0
- package/dist/components/banner_advanced/presentation.js +564 -0
- package/dist/components/banner_advanced/static.html +159 -0
- package/dist/components/banner_basic/import.xml +907 -0
- package/dist/components/banner_basic/manifest.json +151 -0
- package/dist/components/banner_basic/presentation.js +325 -0
- package/dist/components/banner_basic/static.html +86 -0
- package/dist/components/banner_intermediate/import.xml +1473 -0
- package/dist/components/banner_intermediate/manifest.json +248 -0
- package/dist/components/banner_intermediate/presentation.js +410 -0
- package/dist/components/banner_intermediate/static.html +102 -0
- package/dist/components/body/import.xml +343 -0
- package/dist/components/body/manifest.json +46 -0
- package/dist/components/body/presentation.js +37 -0
- package/dist/components/body/static.html +5 -0
- package/dist/components/breadcrumbs/import.xml +95 -0
- package/dist/components/breadcrumbs/manifest.json +9 -0
- package/dist/components/breadcrumbs/presentation.js +99 -0
- package/dist/components/breadcrumbs/static.html +21 -0
- package/dist/components/callout/import.xml +953 -0
- package/dist/components/callout/manifest.json +121 -0
- package/dist/components/callout/presentation.js +103 -0
- package/dist/components/callout/static.html +10 -0
- package/dist/components/card_feature/import.xml +2355 -0
- package/dist/components/card_feature/manifest.json +1390 -0
- package/dist/components/card_feature/presentation.js +365 -0
- package/dist/components/card_feature/static.html +80 -0
- package/dist/components/card_multi_action/import.xml +1539 -0
- package/dist/components/card_multi_action/manifest.json +1314 -0
- package/dist/components/card_multi_action/presentation.js +638 -0
- package/dist/components/card_multi_action/static.html +120 -0
- package/dist/components/card_no_action/import.xml +1449 -0
- package/dist/components/card_no_action/manifest.json +1264 -0
- package/dist/components/card_no_action/presentation.js +454 -0
- package/dist/components/card_no_action/static.html +94 -0
- package/dist/components/card_single_action/import.xml +1539 -0
- package/dist/components/card_single_action/manifest.json +1273 -0
- package/dist/components/card_single_action/presentation.js +498 -0
- package/dist/components/card_single_action/static.html +103 -0
- package/dist/components/code/import.xml +569 -0
- package/dist/components/code/manifest.json +112 -0
- package/dist/components/code/presentation.js +124 -0
- package/dist/components/code/static.html +15 -0
- package/dist/components/footer/import.xml +95 -0
- package/dist/components/footer/manifest.json +9 -0
- package/dist/components/footer/presentation.js +409 -0
- package/dist/components/footer/static.html +146 -0
- package/dist/components/global_alert/import.xml +95 -0
- package/dist/components/global_alert/manifest.json +9 -0
- package/dist/components/global_alert/presentation.js +81 -0
- package/dist/components/global_alert/static.html +26 -0
- package/dist/components/header/import.xml +95 -0
- package/dist/components/header/manifest.json +11 -0
- package/dist/components/header/presentation.js +190 -0
- package/dist/components/header/static.html +158 -0
- package/dist/components/horizontal_rule/import.xml +547 -0
- package/dist/components/horizontal_rule/manifest.json +69 -0
- package/dist/components/horizontal_rule/presentation.js +50 -0
- package/dist/components/horizontal_rule/static.html +4 -0
- package/dist/components/in_page_navigation/import.xml +253 -0
- package/dist/components/in_page_navigation/manifest.json +35 -0
- package/dist/components/in_page_navigation/presentation.js +14 -0
- package/dist/components/in_page_navigation/static.html +13 -0
- package/dist/components/internal_navigation/import.xml +95 -0
- package/dist/components/internal_navigation/manifest.json +11 -0
- package/dist/components/internal_navigation/presentation.js +165 -0
- package/dist/components/internal_navigation/static.html +130 -0
- package/dist/components/left_hand_navigation/import.xml +299 -0
- package/dist/components/left_hand_navigation/manifest.json +40 -0
- package/dist/components/left_hand_navigation/presentation.js +178 -0
- package/dist/components/left_hand_navigation/static.html +64 -0
- package/dist/components/main_navigation/import.xml +95 -0
- package/dist/components/main_navigation/manifest.json +11 -0
- package/dist/components/main_navigation/presentation.js +150 -0
- package/dist/components/main_navigation/static.html +80 -0
- package/dist/components/mega_main_navigation/import.xml +95 -0
- package/dist/components/mega_main_navigation/manifest.json +9 -0
- package/dist/components/mega_main_navigation/presentation.js +380 -0
- package/dist/components/mega_main_navigation/static.html +153 -0
- package/dist/components/multi_column/import.xml +1631 -0
- package/dist/components/multi_column/manifest.json +233 -0
- package/dist/components/multi_column/presentation.js +249 -0
- package/dist/components/multi_column/static.html +36 -0
- package/dist/components/page_alert/import.xml +479 -0
- package/dist/components/page_alert/manifest.json +63 -0
- package/dist/components/page_alert/presentation.js +67 -0
- package/dist/components/page_alert/static.html +8 -0
- package/dist/components/pagination/import.xml +95 -0
- package/dist/components/pagination/manifest.json +42 -0
- package/dist/components/pagination/presentation.js +84 -0
- package/dist/components/pagination/static.html +5 -0
- package/dist/components/updated_date/import.xml +95 -0
- package/dist/components/updated_date/manifest.json +9 -0
- package/dist/components/updated_date/presentation.js +34 -0
- package/dist/components/updated_date/static.html +6 -0
- package/dist/components/widgets/import.xml +95 -0
- package/dist/components/widgets/manifest.json +9 -0
- package/dist/components/widgets/presentation.js +40 -0
- package/dist/components/widgets/static.html +0 -0
- package/dist/components.html +790 -0
- package/dist/externals/componentPreview.js +101 -0
- package/dist/externals/dsComponentLoader.js +410 -0
- package/dist/externals/esri-leaflet-vector.js +5 -0
- package/dist/externals/esri-leaflet.js +12 -0
- package/dist/externals/fb-handlebars.min.js +29 -0
- package/dist/externals/fb-typeahead.bundle.min.js +6 -0
- package/dist/externals/funnelback.autocompletion-2.6.0.js +678 -0
- package/dist/externals/getPagination.js +62 -0
- package/dist/externals/handlebars.min-v4.7.6.js +29 -0
- package/dist/externals/leaflet.js +6 -0
- package/dist/externals/populateDatastoreSim.js +381 -0
- package/dist/externals/tinymce_classes.css +62 -0
- package/dist/home.html +694 -0
- package/dist/index.html +710 -0
- package/dist/inner-with-nav.html +1853 -0
- package/dist/inner.html +671 -0
- package/dist/js/helpers.js +892 -0
- package/dist/js/main.js +55 -0
- package/dist/js/main.js.map +1 -0
- package/dist/js/runtime.js +2 -0
- package/dist/js/runtime.js.map +1 -0
- package/dist/main.css +918 -0
- package/dist/main.css.map +1 -0
- package/dist/mysource_files/ajax-loader.gif +0 -0
- package/dist/mysource_files/favicons/favicon.ico +0 -0
- package/dist/mysource_files/img/100x100.jpg +0 -0
- package/dist/mysource_files/img/600x260.jpg +0 -0
- package/dist/mysource_files/img/Heart-Pattern-Dark.png +0 -0
- package/dist/mysource_files/img/Heart-Pattern.png +0 -0
- package/dist/mysource_files/img/banner-background--desktop.png +0 -0
- package/dist/mysource_files/img/banner-background--mobile.png +0 -0
- package/dist/mysource_files/img/banner-bg.png +0 -0
- package/dist/mysource_files/img/banner.png +0 -0
- package/dist/mysource_files/img/card--brand.png +0 -0
- package/dist/mysource_files/img/card--components.png +0 -0
- package/dist/mysource_files/img/card--content.png +0 -0
- package/dist/mysource_files/img/header-logo-agov.png +0 -0
- package/dist/mysource_files/img/header-logo-qgov--dark.svg +63 -0
- package/dist/mysource_files/img/header-logo-qgov--light.svg +56 -0
- package/dist/mysource_files/img/header-logo-qgov--pre-dark.svg +56 -0
- package/dist/mysource_files/img/header-search.svg +3 -0
- package/dist/mysource_files/img/layers-2x.png +0 -0
- package/dist/mysource_files/img/layers.png +0 -0
- package/dist/mysource_files/img/marker-icon.png +0 -0
- package/dist/mysource_files/img/svg-icons.svg +155 -0
- package/dist/mysource_files/img/video-play.svg +3 -0
- package/dist/mysource_files/slick.eot +0 -0
- package/dist/mysource_files/slick.svg +14 -0
- package/dist/mysource_files/slick.ttf +0 -0
- package/dist/mysource_files/slick.woff +0 -0
- package/package-lock.json +14276 -0
- package/package.json +79 -0
- package/scripts/add_component.sh +109 -0
- package/src/assets/favicons/favicon.ico +0 -0
- package/src/assets/img/100x100.jpg +0 -0
- package/src/assets/img/600x260.jpg +0 -0
- package/src/assets/img/Heart-Pattern-Dark.png +0 -0
- package/src/assets/img/Heart-Pattern.png +0 -0
- package/src/assets/img/banner-background--desktop.png +0 -0
- package/src/assets/img/banner-background--mobile.png +0 -0
- package/src/assets/img/banner-bg.png +0 -0
- package/src/assets/img/banner.png +0 -0
- package/src/assets/img/card--brand.png +0 -0
- package/src/assets/img/card--components.png +0 -0
- package/src/assets/img/card--content.png +0 -0
- package/src/assets/img/header-logo-agov.png +0 -0
- package/src/assets/img/header-logo-qgov--dark.svg +63 -0
- package/src/assets/img/header-logo-qgov--light.svg +56 -0
- package/src/assets/img/header-logo-qgov--pre-dark.svg +56 -0
- package/src/assets/img/header-search.svg +3 -0
- package/src/assets/img/layers-2x.png +0 -0
- package/src/assets/img/layers.png +0 -0
- package/src/assets/img/marker-icon.png +0 -0
- package/src/assets/img/svg-icons.svg +155 -0
- package/src/assets/img/video-play.svg +3 -0
- package/src/components/_global/css/admin/component.scss +71 -0
- package/src/components/_global/css/body/component.scss +897 -0
- package/src/components/_global/css/btn/component.scss +564 -0
- package/src/components/_global/css/cta_links/component.scss +121 -0
- package/src/components/_global/css/direction_links/component.scss +196 -0
- package/src/components/_global/css/example/component.scss +54 -0
- package/src/components/_global/css/forms/control_inputs/component.scss +349 -0
- package/src/components/_global/css/forms/general/component.scss +298 -0
- package/src/components/_global/css/forms/select/component.scss +230 -0
- package/src/components/_global/css/forms/text/component.scss +402 -0
- package/src/components/_global/css/global.scss +42 -0
- package/src/components/_global/css/grid-12/component.scss +331 -0
- package/src/components/_global/css/headings/component.scss +172 -0
- package/src/components/_global/css/icons/component.scss +29 -0
- package/src/components/_global/css/link_columns/component.scss +194 -0
- package/src/components/_global/css/link_list/component.scss +37 -0
- package/src/components/_global/css/modal/component.scss +182 -0
- package/src/components/_global/css/slick/component.scss +25 -0
- package/src/components/_global/css/table/component.scss +211 -0
- package/src/components/_global/css/tabs/component.scss +43 -0
- package/src/components/_global/css/tags/component.scss +272 -0
- package/src/components/_global/css/user_location/component.scss +38 -0
- package/src/components/_global/css/version/component.scss +47 -0
- package/src/components/_global/html/component.hbs +108 -0
- package/src/components/_global/html/ds_component.hbs +30 -0
- package/src/components/_global/html/head.html +63 -0
- package/src/components/_global/html/scripts.html +58 -0
- package/src/components/_global/js/_polyfills/global.js +18 -0
- package/src/components/_global/js/animate/global.js +324 -0
- package/src/components/_global/js/forms/global.js +182 -0
- package/src/components/_global/js/global.js +302 -0
- package/src/components/_global/js/manifest.json +11 -0
- package/src/components/_global/js/modal/global.js +236 -0
- package/src/components/_global/js/slick/global.js +153 -0
- package/src/components/_global/js/tabs/global.js +305 -0
- package/src/components/_global/js/user_location/global.js +116 -0
- package/src/components/_template/css/component.scss +22 -0
- package/src/components/_template/html/component-page.html +85 -0
- package/src/components/_template/html/component.hbs +4 -0
- package/src/components/_template/js/global.js +6 -0
- package/src/components/_template/js/manifest.json +40 -0
- package/src/components/abstract/css/component.scss +91 -0
- package/src/components/abstract/html/component.hbs +9 -0
- package/src/components/abstract/js/manifest.json +29 -0
- package/src/components/accordion/css/component.scss +329 -0
- package/src/components/accordion/html/accordion-group.html +157 -0
- package/src/components/accordion/html/component.hbs +46 -0
- package/src/components/accordion/html/default.html +92 -0
- package/src/components/accordion/js/global.js +413 -0
- package/src/components/accordion/js/manifest.json +427 -0
- package/src/components/banner/css/component.scss +664 -0
- package/src/components/banner/html/component.hbs +52 -0
- package/src/components/banner/js/manifest.json +11 -0
- package/src/components/banner_advanced/css/component.scss +7 -0
- package/src/components/banner_advanced/html/component.hbs +213 -0
- package/src/components/banner_advanced/js/global.js +6 -0
- package/src/components/banner_advanced/js/manifest.json +1450 -0
- package/src/components/banner_basic/css/component.scss +52 -0
- package/src/components/banner_basic/html/component.hbs +130 -0
- package/src/components/banner_basic/js/global.js +6 -0
- package/src/components/banner_basic/js/manifest.json +151 -0
- package/src/components/banner_intermediate/css/component.scss +276 -0
- package/src/components/banner_intermediate/html/component.hbs +165 -0
- package/src/components/banner_intermediate/js/global.js +6 -0
- package/src/components/banner_intermediate/js/manifest.json +248 -0
- package/src/components/body/css/component.scss +16 -0
- package/src/components/body/html/component.hbs +5 -0
- package/src/components/body/js/manifest.json +46 -0
- package/src/components/breadcrumbs/css/component.scss +236 -0
- package/src/components/breadcrumbs/html/component.hbs +29 -0
- package/src/components/breadcrumbs/js/manifest.json +9 -0
- package/src/components/callout/css/component.scss +146 -0
- package/src/components/callout/html/component.hbs +28 -0
- package/src/components/callout/js/manifest.json +121 -0
- package/src/components/card_feature/css/component.scss +224 -0
- package/src/components/card_feature/html/component.hbs +129 -0
- package/src/components/card_feature/js/manifest.json +1390 -0
- package/src/components/card_multi_action/css/component.scss +229 -0
- package/src/components/card_multi_action/html/component.hbs +192 -0
- package/src/components/card_multi_action/js/manifest.json +1314 -0
- package/src/components/card_no_action/css/component.scss +551 -0
- package/src/components/card_no_action/html/component.hbs +127 -0
- package/src/components/card_no_action/js/global.js +6 -0
- package/src/components/card_no_action/js/manifest.json +1264 -0
- package/src/components/card_single_action/css/component.scss +164 -0
- package/src/components/card_single_action/html/component.hbs +161 -0
- package/src/components/card_single_action/js/manifest.json +1273 -0
- package/src/components/code/css/component.scss +355 -0
- package/src/components/code/html/component.hbs +84 -0
- package/src/components/code/js/global.js +160 -0
- package/src/components/code/js/manifest.json +112 -0
- package/src/components/footer/css/component.scss +437 -0
- package/src/components/footer/html/component.hbs +177 -0
- package/src/components/footer/js/manifest.json +9 -0
- package/src/components/global_alert/css/component.scss +169 -0
- package/src/components/global_alert/html/component.hbs +38 -0
- package/src/components/global_alert/js/global.js +39 -0
- package/src/components/global_alert/js/manifest.json +9 -0
- package/src/components/header/css/component.scss +697 -0
- package/src/components/header/html/component.hbs +186 -0
- package/src/components/header/js/global.js +188 -0
- package/src/components/header/js/manifest.json +11 -0
- package/src/components/horizontal_rule/css/component.scss +37 -0
- package/src/components/horizontal_rule/html/component.hbs +6 -0
- package/src/components/horizontal_rule/js/manifest.json +69 -0
- package/src/components/in_page_navigation/css/component.scss +54 -0
- package/src/components/in_page_navigation/html/component.hbs +17 -0
- package/src/components/in_page_navigation/js/global.js +51 -0
- package/src/components/in_page_navigation/js/manifest.json +35 -0
- package/src/components/internal_navigation/css/component.scss +437 -0
- package/src/components/internal_navigation/html/component.hbs +57 -0
- package/src/components/internal_navigation/js/manifest.json +11 -0
- package/src/components/left_hand_navigation/css/component.scss +280 -0
- package/src/components/left_hand_navigation/html/component.hbs +77 -0
- package/src/components/left_hand_navigation/js/global.js +36 -0
- package/src/components/left_hand_navigation/js/manifest.json +40 -0
- package/src/components/main_navigation/css/component.scss +706 -0
- package/src/components/main_navigation/html/component.hbs +87 -0
- package/src/components/main_navigation/js/global.js +373 -0
- package/src/components/main_navigation/js/manifest.json +11 -0
- package/src/components/mega_main_navigation/css/component.scss +535 -0
- package/src/components/mega_main_navigation/html/component.hbs +157 -0
- package/src/components/mega_main_navigation/js/global.js +170 -0
- package/src/components/mega_main_navigation/js/manifest.json +9 -0
- package/src/components/multi_column/css/component.scss +11 -0
- package/src/components/multi_column/html/component.hbs +98 -0
- package/src/components/multi_column/js/manifest.json +233 -0
- package/src/components/page_alert/css/component.scss +132 -0
- package/src/components/page_alert/html/component.hbs +26 -0
- package/src/components/page_alert/js/manifest.json +63 -0
- package/src/components/pagination/css/component.scss +196 -0
- package/src/components/pagination/html/component.hbs +41 -0
- package/src/components/pagination/html/default.html +30 -0
- package/src/components/pagination/js/manifest.json +42 -0
- package/src/components/search_box/css/component.scss +48 -0
- package/src/components/search_box/html/component.html +11 -0
- package/src/components/search_box/js/manifest.json +73 -0
- package/src/components/updated_date/css/component.scss +0 -0
- package/src/components/updated_date/html/component.hbs +31 -0
- package/src/components/updated_date/js/manifest.json +9 -0
- package/src/components/widgets/css/component.scss +82 -0
- package/src/components/widgets/html/component.hbs +19 -0
- package/src/components/widgets/html/default.html +4 -0
- package/src/components/widgets/js/current.json +483 -0
- package/src/components/widgets/js/manifest.json +9 -0
- package/src/components/widgets/js/site.json +358 -0
- package/src/data/current.json +522 -0
- package/src/data/current_admin.json +305 -0
- package/src/data/model_component.js +14 -0
- package/src/data/site.json +762 -0
- package/src/externals/componentPreview.js +101 -0
- package/src/externals/dsComponentLoader.js +410 -0
- package/src/externals/esri-leaflet-vector.js +5 -0
- package/src/externals/esri-leaflet.js +12 -0
- package/src/externals/fb-handlebars.min.js +29 -0
- package/src/externals/fb-typeahead.bundle.min.js +6 -0
- package/src/externals/funnelback.autocompletion-2.6.0.js +678 -0
- package/src/externals/getPagination.js +62 -0
- package/src/externals/handlebars.min-v4.7.6.js +29 -0
- package/src/externals/leaflet.js +6 -0
- package/src/externals/populateDatastoreSim.js +381 -0
- package/src/externals/tinymce_classes.css +62 -0
- package/src/helpers/Handlebars/appendIf.js +6 -0
- package/src/helpers/Handlebars/arrayLength.js +3 -0
- package/src/helpers/Handlebars/arrayWith.js +13 -0
- package/src/helpers/Handlebars/capitaliseFirst.js +8 -0
- package/src/helpers/Handlebars/charMax.js +8 -0
- package/src/helpers/Handlebars/checkIf.js +20 -0
- package/src/helpers/Handlebars/columnWidth.js +39 -0
- package/src/helpers/Handlebars/contains.js +7 -0
- package/src/helpers/Handlebars/createMap.js +19 -0
- package/src/helpers/Handlebars/dsMapFromID.js +8 -0
- package/src/helpers/Handlebars/dsMapFromProp.js +8 -0
- package/src/helpers/Handlebars/eachByName.js +18 -0
- package/src/helpers/Handlebars/eachDS.js +7 -0
- package/src/helpers/Handlebars/eachFrom.js +13 -0
- package/src/helpers/Handlebars/eachUpTo.js +8 -0
- package/src/helpers/Handlebars/eachWhen.js +33 -0
- package/src/helpers/Handlebars/formatDate.js +62 -0
- package/src/helpers/Handlebars/generateDates.js +74 -0
- package/src/helpers/Handlebars/getDistance.js +40 -0
- package/src/helpers/Handlebars/getObject.js +3 -0
- package/src/helpers/Handlebars/getParamaterByName.js +11 -0
- package/src/helpers/Handlebars/getPossibleValues.js +13 -0
- package/src/helpers/Handlebars/getProp.js +3 -0
- package/src/helpers/Handlebars/getTags.js +20 -0
- package/src/helpers/Handlebars/getTitle.js +4 -0
- package/src/helpers/Handlebars/ifAny.js +9 -0
- package/src/helpers/Handlebars/ifArray.js +3 -0
- package/src/helpers/Handlebars/ifCond.js +31 -0
- package/src/helpers/Handlebars/ifEqualsOrChained.js +12 -0
- package/src/helpers/Handlebars/ifProp.js +3 -0
- package/src/helpers/Handlebars/if_eq.js +9 -0
- package/src/helpers/Handlebars/inArray.js +8 -0
- package/src/helpers/Handlebars/isPage.js +7 -0
- package/src/helpers/Handlebars/itemAt.js +11 -0
- package/src/helpers/Handlebars/jsonParse.js +8 -0
- package/src/helpers/Handlebars/jsonStringify.js +3 -0
- package/src/helpers/Handlebars/listAZ.js +51 -0
- package/src/helpers/Handlebars/listAZOptions.js +34 -0
- package/src/helpers/Handlebars/listByClosest.js +60 -0
- package/src/helpers/Handlebars/listByClosestWithOffset.js +63 -0
- package/src/helpers/Handlebars/math.js +11 -0
- package/src/helpers/Handlebars/newLineToBreak.js +6 -0
- package/src/helpers/Handlebars/nonBreakingSpaces.js +6 -0
- package/src/helpers/Handlebars/objectFromSelect.js +21 -0
- package/src/helpers/Handlebars/partialReplace.js +9 -0
- package/src/helpers/Handlebars/printAccordion.js +24 -0
- package/src/helpers/Handlebars/replace.js +8 -0
- package/src/helpers/Handlebars/replaceMany.js +5 -0
- package/src/helpers/Handlebars/sizeFormat.js +11 -0
- package/src/helpers/Handlebars/split.js +6 -0
- package/src/helpers/Handlebars/toUpperCase.js +7 -0
- package/src/helpers/Handlebars/urldecode.js +3 -0
- package/src/helpers/Handlebars/urlencode.js +3 -0
- package/src/helpers/Handlebars/withinObject.js +13 -0
- package/src/html/component-abstract.html +86 -0
- package/src/html/component-accordion.html +87 -0
- package/src/html/component-banner.html +84 -0
- package/src/html/component-banner_advanced.html +97 -0
- package/src/html/component-banner_basic.html +163 -0
- package/src/html/component-banner_intermediate.html +91 -0
- package/src/html/component-body.html +116 -0
- package/src/html/component-breadcrumbs.html +88 -0
- package/src/html/component-btn.html +117 -0
- package/src/html/component-callout.html +86 -0
- package/src/html/component-card_feature.html +631 -0
- package/src/html/component-card_multi_action.html +793 -0
- package/src/html/component-card_no_action.html +521 -0
- package/src/html/component-card_single_action.html +631 -0
- package/src/html/component-code.html +84 -0
- package/src/html/component-footer.html +87 -0
- package/src/html/component-forms.html +585 -0
- package/src/html/component-global-elements.html +531 -0
- package/src/html/component-global_alert.html +87 -0
- package/src/html/component-header.html +88 -0
- package/src/html/component-in_page_navigation.html +109 -0
- package/src/html/component-internal_navigation.html +87 -0
- package/src/html/component-left_hand_navigation.html +85 -0
- package/src/html/component-main_navigation.html +87 -0
- package/src/html/component-mega_main_navigation.html +88 -0
- package/src/html/component-multi_column.html +86 -0
- package/src/html/component-page_alert.html +86 -0
- package/src/html/component-pagination.html +86 -0
- package/src/html/component-tag_list.html +340 -0
- package/src/html/component-updated_date.html +88 -0
- package/src/html/component-widgets.html +90 -0
- package/src/html/components.html +136 -0
- package/src/html/home.html +126 -0
- package/src/html/index.html +142 -0
- package/src/html/inner-with-nav.html +1126 -0
- package/src/html/inner.html +107 -0
- package/src/index.js +12 -0
- package/src/styles/global.scss +120 -0
- package/src/styles/imports/figma.scss +0 -0
- package/src/styles/imports/functions.scss +519 -0
- package/src/styles/imports/mixins.scss +658 -0
- package/src/styles/imports/placeholders.scss +68 -0
- package/src/styles/imports/utilities.scss +185 -0
- package/src/styles/imports/variables.scss +484 -0
- package/src/styles/postcss.config.js +4 -0
- package/webpack/JsonMergePlugin.js +35 -0
- package/webpack/PrecompilePlugin.js +369 -0
- package/webpack/webpack.common.js +151 -0
- package/webpack/webpack.dev.js +54 -0
- package/webpack/webpack.prod.js +70 -0
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
// Convert a pixel value to EM units
|
|
2
|
+
@function pxToEm($pixel) {
|
|
3
|
+
@return $pixel/$base-font-pixel + em;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// Convert a pixel value to REM units
|
|
7
|
+
@function pxToRem($pixel) {
|
|
8
|
+
@return $pixel/$base-font-pixel + rem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Strip unit taken from foundation
|
|
12
|
+
@function stripUnit($num) {
|
|
13
|
+
@return $num / ($num * 0 + 1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// String replace
|
|
17
|
+
@function str-replace($string, $search, $replace: "") {
|
|
18
|
+
$index: str-index($string, $search);
|
|
19
|
+
|
|
20
|
+
@if $index {
|
|
21
|
+
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@return $string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Convert Photoshop Letter spacing to EM
|
|
28
|
+
@function photoshopLetterspacingToEms($val) {
|
|
29
|
+
@return ( $val / 1000 ) * 1em;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Convert Photoshop Letter spacing to PX
|
|
33
|
+
@function photoshopLetterspacingToPixels($val, $font-size) {
|
|
34
|
+
@return ( $val * $font-size / 1000 ) * 1px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
39
|
+
// GLOBAL FUNCTIONS
|
|
40
|
+
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
41
|
+
/**
|
|
42
|
+
* QLD-replace - Replace a string with a string
|
|
43
|
+
* http://codepen.io/jakob-e/pen/doMoML
|
|
44
|
+
*
|
|
45
|
+
* @author @eriksen_dk <https://twitter.com/eriksen_dk>
|
|
46
|
+
*
|
|
47
|
+
* @param {string} $string - The haystack string to be manipulated
|
|
48
|
+
* @param {string} $search - The needle to be replace
|
|
49
|
+
* @param {string} $replace - The replacement
|
|
50
|
+
*
|
|
51
|
+
* @return {string} - The manipulated string with replaced values
|
|
52
|
+
*/
|
|
53
|
+
@function QLD-replace( $string, $search, $replace: '' ) {
|
|
54
|
+
@if type-of( $string ) != 'string' {
|
|
55
|
+
@error "I have a bad feeling about this; the QLD-replace first argument must be a string!";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@if type-of( $search ) != 'string' {
|
|
59
|
+
@error "We’ll always have Paris; the QLD-replace second argument must be a string!";
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@if type-of( $replace ) != 'string' {
|
|
63
|
+
@error "Hasta la vista, baby; the QLD-replace third argument must be a string!";
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
$index: str-index( $string, $search );
|
|
67
|
+
|
|
68
|
+
@return if( $index,
|
|
69
|
+
str-slice( $string, 1, $index - 1 ) +
|
|
70
|
+
$replace +
|
|
71
|
+
QLD-replace(
|
|
72
|
+
str-slice( $string, $index + str-length( $search )
|
|
73
|
+
), $search, $replace ),
|
|
74
|
+
$string
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* QLD-svguri - Generate an optimized SVG data-uri
|
|
81
|
+
* https://codepen.io/tigt/post/optimizing-svgs-in-data-uris
|
|
82
|
+
* http://codepen.io/jakob-e/pen/doMoML
|
|
83
|
+
*
|
|
84
|
+
* @author @eriksen_dk <https://twitter.com/eriksen_dk>
|
|
85
|
+
*
|
|
86
|
+
* @param {string} $svg - The SVG to be converted
|
|
87
|
+
*
|
|
88
|
+
* @return {string} - An optimized data-uri
|
|
89
|
+
*/
|
|
90
|
+
@function QLD-svguri( $svg ) {
|
|
91
|
+
@if type-of( $svg ) != 'string' {
|
|
92
|
+
@error "With great power comes great responsibility; the QLD-svguri function only takes a string!";
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@if not str-index( $svg, xmlns ) { // Add missing namespace
|
|
96
|
+
$svg: QLD-replace( $svg, '<svg','<svg xmlns="http://www.w3.org/2000/svg"' );
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
$encoded:'';
|
|
100
|
+
$slice: 2000;
|
|
101
|
+
$index: 0;
|
|
102
|
+
$loops: ceil( str-length( $svg ) / $slice ); // Chunk up string in order to avoid "stack level too deep" error
|
|
103
|
+
|
|
104
|
+
@for $i from 1 through $loops {
|
|
105
|
+
$chunk: str-slice( $svg, $index, $index + $slice - 1 );
|
|
106
|
+
|
|
107
|
+
$chunk: QLD-replace( $chunk,'"', "'" );
|
|
108
|
+
$chunk: QLD-replace( $chunk,' ', " " );
|
|
109
|
+
$chunk: QLD-replace( $chunk,"\a", " " );
|
|
110
|
+
$chunk: QLD-replace( $chunk,' ', " " );
|
|
111
|
+
$chunk: QLD-replace( $chunk,'%', '%25' );
|
|
112
|
+
$chunk: QLD-replace( $chunk,'&', '%26' );
|
|
113
|
+
$chunk: QLD-replace( $chunk,'#', '%23' );
|
|
114
|
+
$chunk: QLD-replace( $chunk,'{', '%7B' );
|
|
115
|
+
$chunk: QLD-replace( $chunk,'}', '%7D' );
|
|
116
|
+
$chunk: QLD-replace( $chunk,'<', '%3C' );
|
|
117
|
+
$chunk: QLD-replace( $chunk,'>', '%3E' );
|
|
118
|
+
|
|
119
|
+
/* The maybe list
|
|
120
|
+
|
|
121
|
+
Keep size and compile time down
|
|
122
|
+
... only add on documented fail
|
|
123
|
+
|
|
124
|
+
$chunk: QLD-replace( $chunk, '|', '%7C' );
|
|
125
|
+
$chunk: QLD-replace( $chunk, '[', '%5B' );
|
|
126
|
+
$chunk: QLD-replace( $chunk, ']', '%5D' );
|
|
127
|
+
$chunk: QLD-replace( $chunk, '^', '%5E' );
|
|
128
|
+
$chunk: QLD-replace( $chunk, '`', '%60' );
|
|
129
|
+
$chunk: QLD-replace( $chunk, ';', '%3B' );
|
|
130
|
+
$chunk: QLD-replace( $chunk, '?', '%3F' );
|
|
131
|
+
$chunk: QLD-replace( $chunk, ':', '%3A' );
|
|
132
|
+
$chunk: QLD-replace( $chunk, '@', '%40' );
|
|
133
|
+
$chunk: QLD-replace( $chunk, '=', '%3D' );
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
$encoded: #{ $encoded }#{ $chunk };
|
|
137
|
+
$index: $index + $slice;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@return url("data:image/svg+xml,#{ $encoded }");
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* QLD-factorial - Returns the factorial of a non-negative integer.
|
|
146
|
+
* https://github.com/terkel/mathsass
|
|
147
|
+
*
|
|
148
|
+
* @author Pascal Duez @pascalduez <http://pascalduez.me/>
|
|
149
|
+
*
|
|
150
|
+
* @param {integer} $number - A non-negative integer.
|
|
151
|
+
*
|
|
152
|
+
* @return {integer} - The factorial log
|
|
153
|
+
*/
|
|
154
|
+
@function QLD-factorial( $number ) {
|
|
155
|
+
@if $number < 0 or $number != floor( $number ) {
|
|
156
|
+
@error "You talking to me?; the QLD-factorial function only takes positive numbers.";
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
$factorial: 1;
|
|
160
|
+
|
|
161
|
+
@while $number > 0 {
|
|
162
|
+
$factorial: $factorial * $number;
|
|
163
|
+
$number: $number - 1;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
@return $factorial;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* QLD-pow - Returns base to the exponent power.
|
|
172
|
+
* https://github.com/terkel/mathsass
|
|
173
|
+
*
|
|
174
|
+
* @author Pascal Duez @pascalduez <http://pascalduez.me/>
|
|
175
|
+
*
|
|
176
|
+
* @param {integers} $base - The base number
|
|
177
|
+
* @param {integers} $exponent - The exponent to which to raise base
|
|
178
|
+
*
|
|
179
|
+
* @return {integers} - The result of the math
|
|
180
|
+
*/
|
|
181
|
+
@function QLD-pow( $base, $exponent ) {
|
|
182
|
+
@if $exponent < 0 {
|
|
183
|
+
@error "I can see dead people; the QLD-pow function only takes positive numbers as the second argument.";
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Constants
|
|
187
|
+
$LN2: 0.6931471805599453;
|
|
188
|
+
$SQRT2: 1.4142135623730951;
|
|
189
|
+
|
|
190
|
+
// full number
|
|
191
|
+
@if $exponent == floor( $exponent ) {
|
|
192
|
+
$rest: 1;
|
|
193
|
+
|
|
194
|
+
@if $exponent < 0 {
|
|
195
|
+
$exponent: $exponent * -1;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@while $exponent > 0 {
|
|
199
|
+
@if $exponent % 2 == 1 {
|
|
200
|
+
$rest: $rest * $base;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
$exponent: floor($exponent * 0.5);
|
|
204
|
+
$base: $base * $base;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
@return if( $exponent < 0, 1 / $rest, $rest );
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// decimal number
|
|
211
|
+
@else {
|
|
212
|
+
@if $base <= 0 {
|
|
213
|
+
@return 0 / 0;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
$normalized: ( $base / $SQRT2 );
|
|
217
|
+
$log: 0;
|
|
218
|
+
|
|
219
|
+
@if $normalized < 0 {
|
|
220
|
+
$normalized: $normalized * -1;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@if $normalized < 0.5 {
|
|
224
|
+
@while $normalized < 0.5 {
|
|
225
|
+
$normalized: $normalized * 2;
|
|
226
|
+
$log: $log - 1;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
@else if $normalized >= 1 {
|
|
231
|
+
@while $normalized >= 1 {
|
|
232
|
+
$normalized: $normalized / 2;
|
|
233
|
+
$log: $log + 1;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
$divider: 1;
|
|
238
|
+
$deviderExponent: $log;
|
|
239
|
+
|
|
240
|
+
$baseExponent: if( $deviderExponent >= 0, 2, 1 / 2 );
|
|
241
|
+
|
|
242
|
+
@if $deviderExponent < 0 {
|
|
243
|
+
$deviderExponent: $deviderExponent * -1;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
@while $deviderExponent > 0 {
|
|
247
|
+
@if $deviderExponent % 2 == 1 {
|
|
248
|
+
$divider: $divider * $baseExponent;
|
|
249
|
+
}
|
|
250
|
+
$baseExponent: $baseExponent * $baseExponent;
|
|
251
|
+
$deviderExponent: floor( $deviderExponent * 0.5 );
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
$base: $base / $divider;
|
|
255
|
+
$base: ( $base - 1 ) / ( $base + 1 );
|
|
256
|
+
$base2: $base * $base;
|
|
257
|
+
$iterator: 1;
|
|
258
|
+
$tempBase: $base;
|
|
259
|
+
$tempBase2: null;
|
|
260
|
+
|
|
261
|
+
@while $tempBase2 != $tempBase {
|
|
262
|
+
$base: $base * $base2;
|
|
263
|
+
$iterator: $iterator + 2;
|
|
264
|
+
$tempBase2: $tempBase;
|
|
265
|
+
$tempBase: $tempBase + $base / $iterator;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
$logarithm: ( $LN2 * $log + 2 * $tempBase ) * $exponent;
|
|
269
|
+
$return: 0;
|
|
270
|
+
|
|
271
|
+
@for $quarter from 0 to 24 {
|
|
272
|
+
$return: $return + QLD-pow( $logarithm, $quarter ) / QLD-factorial( $quarter );
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
@return $return;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* QLD-color-luminance - Calculate color luminance
|
|
282
|
+
*
|
|
283
|
+
* https://github.com/voxpelli/sass-color-helpers/blob/master/stylesheets/color-helpers/_contrast.scss
|
|
284
|
+
* Adapted from: https://github.com/LeaVerou/contrast-ratio/blob/gh-pages/color.js
|
|
285
|
+
* Formula: http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
|
286
|
+
*
|
|
287
|
+
* @author Pelle Wessman @voxpelli <http://kodfabrik.se/>
|
|
288
|
+
*
|
|
289
|
+
* @param {string} $color - The color to calculate the luminance from
|
|
290
|
+
*
|
|
291
|
+
* @return {float} - The luminance
|
|
292
|
+
*/
|
|
293
|
+
@function QLD-color-luminance( $color ) {
|
|
294
|
+
@if type-of( $color ) != 'color' {
|
|
295
|
+
@error "Go ahead, make my day; the QLD-color-luminance function only takes a color!";
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
$rgba: red( $color ), green( $color ), blue( $color );
|
|
299
|
+
$rgba2: ();
|
|
300
|
+
|
|
301
|
+
@for $i from 1 through 3 {
|
|
302
|
+
$rgb: nth( $rgba, $i );
|
|
303
|
+
$rgb: $rgb / 255;
|
|
304
|
+
|
|
305
|
+
$rgb: if( $rgb < .03928, $rgb / 12.92, QLD-pow( ( $rgb + .055 ) / 1.055, 2.4 ) );
|
|
306
|
+
|
|
307
|
+
$rgba2: append( $rgba2, $rgb );
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
@return .2126 * nth( $rgba2, 1 ) + .7152 * nth( $rgba2, 2 ) + 0.0722 * nth( $rgba2, 3 );
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* QLD-color-contrast - Get the contrast ratio of two colors and warn when it is below WCAG 2.0 AA standard 4.5:1
|
|
316
|
+
*
|
|
317
|
+
* https://github.com/voxpelli/sass-color-helpers/blob/master/stylesheets/color-helpers/_contrast.scss
|
|
318
|
+
* Adapted from: https://github.com/LeaVerou/contrast-ratio/blob/gh-pages/color.js
|
|
319
|
+
* Formula: http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef
|
|
320
|
+
*
|
|
321
|
+
* @author Pelle Wessman @voxpelli <http://kodfabrik.se/>
|
|
322
|
+
*
|
|
323
|
+
* @param {string} $foreground - Color one
|
|
324
|
+
* @param {string} $background - Color two
|
|
325
|
+
* @param {boolean} $silent - If the logs get printed in the terminal
|
|
326
|
+
* @param {boolean} $rounded - If the value is rounded or not
|
|
327
|
+
*
|
|
328
|
+
* @return {integer} - The contrast ratio
|
|
329
|
+
*/
|
|
330
|
+
@function QLD-color-contrast( $foreground, $background, $silent: false, $rounded: true ) {
|
|
331
|
+
@if type-of( $foreground ) != 'color' {
|
|
332
|
+
@error "Elementary, my dear Watson; the QLD-color-contrast function only takes a color as first argument!";
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
@if type-of( $background ) != 'color' {
|
|
336
|
+
@error "You can’t handle the truth; the QLD-color-contrast function only takes a color as second argument!";
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
$luminance1: QLD-color-luminance( $foreground ) + .05;
|
|
340
|
+
$luminance2: QLD-color-luminance( $background ) + .05;
|
|
341
|
+
$ratio: $luminance1 / $luminance2;
|
|
342
|
+
|
|
343
|
+
@if $luminance2 > $luminance1 {
|
|
344
|
+
$ratio: 1 / $ratio;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
@if $ratio < 4.5 and $silent == false {
|
|
348
|
+
@warn "Houston, we have a problem; contrast ratio of #{ $foreground } on #{ $background } is bad, just #{ $ratio }";
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
@if $rounded == true {
|
|
352
|
+
$ratio: round( $ratio * 10 ) / 10;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
@return $ratio;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* QLD-color-a11y - The function to find the nearest accessible color
|
|
362
|
+
*
|
|
363
|
+
* https://github.com/alex-page/sass-a11ycolor
|
|
364
|
+
*
|
|
365
|
+
* @author Alex Page @aalexpaage <http://alexpage.com.au>
|
|
366
|
+
*
|
|
367
|
+
* @param {Color} $toMakeA11y - The color that is to be changed
|
|
368
|
+
* @param {Color} $background - The background color to compare against toMakeA11y for the contrast
|
|
369
|
+
* @param {'small'|'large'} $ratioKey ['small'] - The keyword 'small' or 'large' to set the WCAG 2.1 contrast ration or 3.0 or 4.5
|
|
370
|
+
* @param {Number} $steps [0.1] - The step size our function is searching for a new color in. The bigger the number the faster the process
|
|
371
|
+
* the rougher the found color.
|
|
372
|
+
*
|
|
373
|
+
* @return {Color} - Returns the nearest accessible color
|
|
374
|
+
*/
|
|
375
|
+
@function QLD-color-a11y( $toMakeA11y, $background, $ratioKey: 'small' ) {
|
|
376
|
+
@if type-of( $toMakeA11y ) != 'color' {
|
|
377
|
+
@error "Where we’re going, we don’t need roads; the QLD-a11ycolor function only takes a color as the first attribute!";
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
@if type-of( $background ) != 'color' {
|
|
381
|
+
@error "You shall not pass; the QLD-a11ycolor function only takes a color as the second attribute!";
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
@if $ratioKey != 'small' and $ratioKey != 'large' {
|
|
385
|
+
@error "I have always depended on the kindness of strangers; the QLD-a11ycolor function only takes 'small' or 'large' as third attribute.";
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
$ratios: (
|
|
390
|
+
'large': 3,
|
|
391
|
+
'small': 4.5,
|
|
392
|
+
);
|
|
393
|
+
$ratio: map-get( $ratios, $ratioKey );
|
|
394
|
+
|
|
395
|
+
// Check the ratio straight away, if it passes return the value as hex
|
|
396
|
+
@if QLD-color-contrast( $toMakeA11y, $background, true, false ) >= $ratio {
|
|
397
|
+
@return $toMakeA11y;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// Ratio didn't pass so we need to find the nearest color
|
|
401
|
+
$a11yLightness: lightness( $toMakeA11y );
|
|
402
|
+
$minHexDiff: 100 / 255; // 255 Colors / 100% HSL
|
|
403
|
+
|
|
404
|
+
$isBlackBgContrast: QLD-color-contrast( #000, $background, true, false ) >= $ratio;
|
|
405
|
+
$isWhiteBgContrast: QLD-color-contrast( #fff, $background, true, false ) >= $ratio;
|
|
406
|
+
$minLightness: 0;
|
|
407
|
+
$maxLightness: 100;
|
|
408
|
+
$isDarkColor: false;
|
|
409
|
+
|
|
410
|
+
// If our colour passes contrast on black and white
|
|
411
|
+
@if $isBlackBgContrast and $isWhiteBgContrast {
|
|
412
|
+
// Change the min lightness if the color is light
|
|
413
|
+
@if( $a11yLightness >= 50 ) {
|
|
414
|
+
$minLightness: $a11yLightness;
|
|
415
|
+
}
|
|
416
|
+
// Change the max lightness if the color is dark
|
|
417
|
+
@else {
|
|
418
|
+
$maxLightness: $a11yLightness;
|
|
419
|
+
$isDarkColor: true;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
@else if $isBlackBgContrast {
|
|
423
|
+
$maxLightness: $a11yLightness;
|
|
424
|
+
$isDarkColor: true;
|
|
425
|
+
}
|
|
426
|
+
// It didn't pass on black
|
|
427
|
+
@else {
|
|
428
|
+
$minLightness: $a11yLightness;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// The color to return
|
|
432
|
+
$foundColor: '';
|
|
433
|
+
|
|
434
|
+
// Binary search until we find the colour that meets contrast
|
|
435
|
+
@while( $foundColor == '' ) {
|
|
436
|
+
$midLightness: ( $minLightness + $maxLightness ) / 2;
|
|
437
|
+
$midColor: hsl(
|
|
438
|
+
hue( $toMakeA11y ),
|
|
439
|
+
saturation( $toMakeA11y ),
|
|
440
|
+
$midLightness
|
|
441
|
+
);
|
|
442
|
+
$resetColor: mix( $midColor, $midColor );
|
|
443
|
+
|
|
444
|
+
// If we meet contrast
|
|
445
|
+
@if QLD-color-contrast( $resetColor, $background, true, false ) >= $ratio {
|
|
446
|
+
// The colour is in the minimal lightness range for one hexadecimal
|
|
447
|
+
@if $maxLightness - $minLightness < $minHexDiff {
|
|
448
|
+
$foundColor: $resetColor;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
@if $isDarkColor {
|
|
452
|
+
$minLightness: $midLightness;
|
|
453
|
+
}
|
|
454
|
+
@else {
|
|
455
|
+
$maxLightness: $midLightness;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
// We don't meet contrast
|
|
459
|
+
@else if $isDarkColor {
|
|
460
|
+
$maxLightness: $midLightness;
|
|
461
|
+
}
|
|
462
|
+
@else {
|
|
463
|
+
$minLightness: $midLightness;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
@return $foundColor;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* QLD-color-lowest-contrast - Find the lowest contrast color
|
|
473
|
+
*
|
|
474
|
+
* @param {Colors} $colors - The color to find the lowest contrast
|
|
475
|
+
* @param {Color} $background - The background color to compare the colors against
|
|
476
|
+
*
|
|
477
|
+
* @return {Color} - Returns the lowest contrast color
|
|
478
|
+
*/
|
|
479
|
+
@function QLD-color-lowest-contrast( $colors, $background ){
|
|
480
|
+
$current-lowest: nth( $colors, 1 );
|
|
481
|
+
|
|
482
|
+
// Loop through the $colors list
|
|
483
|
+
@each $color in $colors {
|
|
484
|
+
$colorContrast: QLD-color-contrast( $color, $background, true, false );
|
|
485
|
+
$lowestContrast: QLD-color-contrast( $current-lowest, $background, true, false );
|
|
486
|
+
|
|
487
|
+
// If the constast is lower make it the new lowest
|
|
488
|
+
@if $colorContrast < $lowestContrast {
|
|
489
|
+
$current-lowest: $color;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
@return $current-lowest;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* QLD-svg-with-fill - Select which level of box shadow
|
|
499
|
+
*
|
|
500
|
+
* @param {keywords} $level - Either one of the following 1, 2, 3
|
|
501
|
+
*
|
|
502
|
+
* @return {string} - Returns different box-shadow variables
|
|
503
|
+
*/
|
|
504
|
+
@function QLD-svg-with-fill($svg, $new-fill: 'currentColor') {
|
|
505
|
+
|
|
506
|
+
$fill-to-replace: 'currentColor';
|
|
507
|
+
$css-var: #{var($new-fill)};
|
|
508
|
+
// $this-new-fill: $new-fill;
|
|
509
|
+
|
|
510
|
+
// var(--QLD-color-dark-alt-button)
|
|
511
|
+
$replaced-svg: str-replace($svg, $fill-to-replace, $css-var);
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
$replaced-svg-url: QLD-svguri('#{$replaced-svg}');
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
@return $replaced-svg-url;
|
|
519
|
+
}
|