-
AuthorPosts
-
October 21, 2017 at 1:13 am #866908
I am trying to really hard to keep my sanity with this, but it feels like styling buttons dynamically with classes in Enfold is a exercise in insanity.
Yes, I am aware I can style buttons individually, but that makes for a nightmare if you want to make changes. The idea of css is that you can style across the dom in a way that allow flexibility, yet precision.
My goal is to have 5 different color schemes for buttons. I can do the css in my sleep, but it seems like no matter what I do, elements override what I am trying to accomplish.
Is there a way to clear thematic button styling?
Here’s why. Look at this selector:
.avia-button-wrap.avia-button-left.avia-builder-el-19.el_after_av_textblock.avia-builder-el-last.button-section-nsIt is a mess and I can do the changes I need to it, but then it will pick and choose what it wants to override, like the text colors within it.
I am going to back away from it for a bit here and come back, but there has got to be a better way to do dynamic css classed buttons.
October 22, 2017 at 7:09 am #867161Hey Jason,
Did you activate the custom CSS field on your installation? http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/. That should make things a lot easier for you.
Best regards,
RikardOctober 22, 2017 at 7:19 am #867163Yes, of course. I could not apply classes without it.
October 22, 2017 at 9:02 am #867170what do you think about that:
Using the Enfold Button Element with light-transparent but with other styling – just css
give the new class to the button (here it is glass green)
put in the field of custom css : glass green
for blue one : glass blue do not put in the classes with the dot (point) ! those are added by default
etc if you likehttps://webers-testseite.de/buttons/
/* to get rid of enfold styling - use light-transparent */ #top .avia-button.avia-color-light { color: inherit !important; border: none !important; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; box-shadow: none !important } #top .avia-button.avia-color-light:hover { opacity: 0.9 !important; text-shadow: 1px 1px 2px #333 } /* font-size of the button and the icon */ #top .avia-button.avia-color-light { font-size: 1.2rem } .avia-button.avia-color-light .avia_button_icon { font-size: 1.5rem; vertical-align: bottom } /* new button style - a bit glassy */ .glass { position: relative; display: inline-block; border-radius: 4px; box-shadow: 1px 1px 4px #666; /* goes to style the text */ text-decoration: none; text-shadow: 1px 1px 2px #333; } .glass:before{ content: ''; position: absolute; top: 2px; left: 2px; width: calc(100% - 4px); height: 50%; } .glass:before{ background: linear-gradient(rgba(255,255,255,0.8), rgba(255,255,255,0.2)) } /* the green one */ .green { background-color: green; /*for compatibility with older browsers*/ background-image: linear-gradient(green,lightgreen); color: #fff } .green:hover { background: linear-gradient(#073,#0fa) } /* the blue one */ .blue { background-color: blue; /*for compatibility with older browsers*/ background-image: linear-gradient(blue,lightblue); color: #fff } .blue:hover { background: linear-gradient(#047,#0ef) } /* the red one */ .red { background-color: red; /*for compatibility with older browsers*/ background-image: linear-gradient(#ea0404 ,#6d0019); color: #fff } .red:hover { background: linear-gradient(#a00,#e00) }
and now the rest is your turn – make some other classes with other gradients!
Here you can make your gradients: Link
October 22, 2017 at 9:27 am #867172so now i have splitted the styling and the colors
as described you have to take the light-transparent styling of enfold and put in two classes
one for the style and one for colors- This reply was modified 7 years, 1 month ago by Guenni007.
October 24, 2017 at 7:22 pm #868345Guenni,
Thank you. This was a different approach than what we have used in the past, and seems to work much better. Thank you so much for both figuring it out, but also offering to share your knowledge and experience. Hopefully, I can repay at some point along the way.
This example might be a good candidate to showcase in the example snippets section of the Enfold support site.
-jason
October 25, 2017 at 8:39 am #868596 -
AuthorPosts
- The topic ‘Pulling my hair out with styling buttons’ is closed to new replies.