{"id":10341,"date":"2018-12-14T04:35:30","date_gmt":"2018-12-14T04:35:30","guid":{"rendered":"http:\/\/webartdevelopers.com\/?p=10341"},"modified":"2020-12-24T11:35:49","modified_gmt":"2020-12-24T11:35:49","slug":"material-inspired-checkboxes","status":"publish","type":"post","link":"https:\/\/webartdevelopers.com\/blog\/material-inspired-checkboxes\/","title":{"rendered":"MATERIAL INSPIRED CHECKBOXES"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\"><strong><u><em>Author:<\/em><\/u><\/strong><\/h4>\n\n\n\n<ul><li>Buddy Reno<\/li><li>September 12, 2017<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong><u><em>Made with:<\/em><\/u><\/strong><\/h4>\n\n\n\n<ul><li>HTML<\/li><li>CSS\/SCSS<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong><u><em>About the code:<\/em><\/u><\/strong><\/h4>\n\n\n\n<p>This is a nice and simple trick to this is placing the label after the checkbox. That way you can use the\u00a0<code>:checked<\/code>\u00a0state to toggle the different pseudo elements on the label. No javascript necessary. To make the background animation work, you&#8217;ll need a tiny bit of magic. The\u00a0<code>label:before<\/code>\u00a0element is a small 10&#215;10 circle. We animate the scale of it instead of the size so that we can keep the proportion of the circle and make it look like it &#8220;fills out&#8221; the bar. The max width of the form is set to 550px. The\u00a0<code>:before<\/code>\u00a0element animates by using\u00a0<code>scale3d<\/code>\u00a0(for hardware acceleration) by 56 times. 56 * 10 === 560. This allows the circle to fill out the bar by going slightly outside the bounds of the input group container.<\/p>\n\n\n<a href=\"https:\/\/codepen.io\/BuddyLReno\/share\/zip\/boGRPO\" class=\"su-button su-button-style-default\" style=\"color:#ffffff;background-color:#000000;border-color:#000000;border-radius:40px\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color:#ffffff;padding:0px 20px;font-size:16px;line-height:32px;border-color:#4d4d4d;border-radius:40px;text-shadow:none\"> Download<\/span><\/a>\n\n\n<a href=\"https:\/\/codepen.io\/BuddyLReno\/pen\/boGRPO\" class=\"su-button su-button-style-default\" style=\"color:#ffffff;background-color:#000000;border-color:#000000;border-radius:40px\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color:#ffffff;padding:0px 20px;font-size:16px;line-height:32px;border-color:#4d4d4d;border-radius:40px;text-shadow:none\"> Demo and Code<\/span><\/a>\n<!-- AddThis Advanced Settings generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"Author: Buddy Reno September 12, 2017 Made with: HTML CSS\/SCSS About the code: This is a nice and simple trick to this is placing the label after the checkbox. That way you can use the\u00a0:checked\u00a0state to toggle the different pseudo elements on the label. No javascript necessary. To make the background animation work, you&#8217;ll need a tiny bit of magic. The\u00a0label:before\u00a0element is a small 10&#215;10 circle. We animate the scale of it instead of the size so that we can keep the proportion of the circle and make it look like it &#8220;fills out&#8221; the bar. The max width of the form is set to 550px. The\u00a0:before\u00a0element animates by using\u00a0scale3d\u00a0(for hardware acceleration) by 56 times. 56 * 10 === 560. <!-- AddThis Advanced Settings generic via filter on get_the_excerpt -->","protected":false},"author":1,"featured_media":10346,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2901],"tags":[20,2907,2911],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/posts\/10341"}],"collection":[{"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/comments?post=10341"}],"version-history":[{"count":2,"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/posts\/10341\/revisions"}],"predecessor-version":[{"id":24100,"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/posts\/10341\/revisions\/24100"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/media\/10346"}],"wp:attachment":[{"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/media?parent=10341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/categories?post=10341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webartdevelopers.com\/blog\/wp-json\/wp\/v2\/tags?post=10341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}