question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot set shadow on dropdown menu

See original GitHub issue

How do I set a shadow on the drop-down menu?

            <b-dropdown size="sm" variant="primary">
              <div class="shadow">...</div>
            </b-dropdown>

  .shadow{
    -webkit-box-shadow: 5px 5px 15px 0px rgba(0,0,0,0.5);
    -moz-box-shadow: 5px 5px 15px 0px rgba(0,0,0,0.5);
    box-shadow: 5px 5px 15px 0px rgba(0,0,0,0.5);
  }

I could do this with plain bootstrap :

<div class="dropdown-menu shadow">...</div>

Now the above code sets the shadow on the inner div but not the whole menu. When using F12 I see there is a parent ul which wraps my div with class dropdown-menu but setting any shadow css on that class has no effect!

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tmorehousecommented, Jun 26, 2019

You can find out more about the limitations (and workarounds) for scoped styles and child components at https://vue-loader.vuejs.org/guide/scoped-css.html#child-component-root-elements

0reactions
tmorehousecommented, Jun 26, 2019

An alternative, if using an existing “shadow” class:

<b-dropdown menu-class="shadow">
</b-dropdown>

This will add the class (or classes) specified in prop menu-c;lass to the rendered .dropdown-menu <ul> element.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add shadows in the dropdown menu - css - Stack Overflow
But i cant figure that out. I've added this code: .nav-dropdown { box-shadow: none; }.
Read more >
Shadow effect behind drop down menu - Squarespace Forum
Hi! I am trying to create this cool shadow effect that appears behind the nav drop down menu. Currently, it looks like the...
Read more >
box-shadow - CSS-Tricks
The box-shadow property in CSS is for putting shadows on elements (sometimes referred to as “drop shadows”, ala Photoshop/Figma).
Read more >
3 ways to style CSS box-shadow effects - LogRocket Blog
The box-shadow property allows you add a shadow around an element on a webpage. It can tell us if an element like a...
Read more >
Dropdown | Webflow University
Use the built-in Webflow dropdown component to add, style, and set up dropdown menus and links. ... Your browser can't play this video....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found