From 1d282aef8722e5707efdf89781ddbc97707beef1 Mon Sep 17 00:00:00 2001 From: Ruchita Date: Wed, 28 Feb 2024 20:21:33 +0530 Subject: [PATCH] added themes for star rating --- src/components/starrating/_starrating.scss | 73 ++++++++++++++++++++++ src/theme.scss | 1 + 2 files changed, 74 insertions(+) create mode 100644 src/components/starrating/_starrating.scss diff --git a/src/components/starrating/_starrating.scss b/src/components/starrating/_starrating.scss new file mode 100644 index 0000000..f4cf1d0 --- /dev/null +++ b/src/components/starrating/_starrating.scss @@ -0,0 +1,73 @@ +/* ===============Star Rating================== */ + +.cmp-adaptiveform-starrating { + align-items: center; +} +.cmp-adaptiveform-starrating--label { + font-size: 35px; + line-height: 1; + color:black; + position: relative; + z-index: 1; +} + +.cmp-adaptiveform-starrating__option__widget { + appearance: none; +} + +.cmp-adaptiveform-starrating__filled { + color: red!important; +} + +.cmp-adaptiveform-starrating__option__widget + label:before { + content: '★'; +} + +.cmp-adaptiveform-starrating__widget label { + font-size: 50px; + line-height: 1; + color: pink; + transition: 0.2s ease; +} + +.cmp-adaptiveform-starrating__widget label:hover { + color: yellow; + transition: 0.2s ease; +} +.cmp-adaptiveform-starrating__shortdescription { + font-size: $font-sm; + margin-top: $error-top-margin; +} +.cmp-adaptiveform-starrating__questionmark{ + display:inline-block; + width:1rem; + height:1rem; + border-radius: 9px; + background: url(./resources/images/question.svg) center center / cover no-repeat,#969696; + cursor : pointer; + // below properties for backward compatibility + position: absolute; + right: 20px; +} +// below properties for backward compatibility +.cmp-adaptiveform-starrating__label-container .cmp-adaptiveform-starrating__questionmark{ + position: unset; + right: unset; +} +.cmp-adaptiveform-starrating__errormessage{ + color: $error; + font-size: $font-sm; + margin-top: $error-top-margin; +} +.cmp-adaptiveform-starrating[data-cmp-valid=false]{ + background: $light-error; + border: 0 solid $error; + border-inline-start-width: 4px; + padding-inline-start: 5px; +} +.cmp-adaptiveform-starrating[data-cmp-valid=true]{ + border: 0 solid $success; + border-inline-start-width: 4px; + padding-inline-start: 5px; +} + diff --git a/src/theme.scss b/src/theme.scss index fdf1aaa..244304b 100644 --- a/src/theme.scss +++ b/src/theme.scss @@ -36,3 +36,4 @@ @import 'src/components/checkbox/_checkbox.scss'; @import 'src/components/termsandconditions/_termsandconditions.scss'; @import 'src/components/switch/_switch.scss'; +@import 'src/components/starrating/_starrating.scss'; \ No newline at end of file