Coder Social home page Coder Social logo

Transparent shot background about polacode HOT 9 CLOSED

octref avatar octref commented on May 11, 2024 36
Transparent shot background

from polacode.

Comments (9)

tobi-or-not-tobi avatar tobi-or-not-tobi commented on May 11, 2024 7

I've checked the code of this extension and based on that tweaked the underlying css a little bit to accomplish this. There are a few caveats that might be worth mentioning:

  • the background of the image depends on the colorTheme of vscode, i.e. light vs dark. Light theme's actually already get a transparent background. The reason for the dark theme not to have this, is most probably because the image looks horrible in preview mode, since the transparent background gets dark by the vscode background.
  • the huge spread of the css box shadow and the relatively small padding is causing the hard cut on the edge of the image. That can be easily fixed by either changing the box-shadow or padding, or both.

In order to this quick and dirty for my self I changed the following in the index.html provided in the src/webview folder:

#snippet-container {
  background-color: transparent !important; // ensure bg is always transparent (looks ugly in preview though)
  padding: 50px; // ensure we have enough padding to avoid a hard cut of the shadow
}

#snippet {
  box-shadow: 0px 0px 71px -17px rgba(0, 0, 0, 0.75); // just an alternative shadow
}

I think that the different options should be configurable, using properties, however the default settings should provide an image without the hard cut of the edges. Then we don't need to agree in this ticket on the exact style rules...
Next, we should have a better preview, so that the transparent background of the image doesn't clash with vscode background.

This can be done in different ways. Happy to join with a PR, let me know if that makes sense.

from polacode.

MatteoGabriele avatar MatteoGabriele commented on May 11, 2024 2

@jeremy-ingenuity I used it here and if you see, without that cropping would have looked so much better.

from polacode.

rediche avatar rediche commented on May 11, 2024 2

Transparent background would be absolutely amazing.

from polacode.

nerdenough avatar nerdenough commented on May 11, 2024 2

I'm keen for transparency as well, but the drop shadow currently extends past the edge of the image so you'd need to adjust that too 🤔

from polacode.

MatteoGabriele avatar MatteoGabriele commented on May 11, 2024

Yeah I was actually looking for the same feature.
I seriously love this plugin and with a transparent background and not cut on the shadow will be perfect to drop in a Medium article for example for a very nice and clean look.

thanks for you effort

from polacode.

jeremy-ingenuity avatar jeremy-ingenuity commented on May 11, 2024

Yes same here @MatteoGabriele , I was using it for a Medium post :D

Thank you very much to the developer!

from polacode.

bestony avatar bestony commented on May 11, 2024

Yes, I also need this feature, I want to use this plugin in my PowerPoint!

from polacode.

MadMaxMcKinney avatar MadMaxMcKinney commented on May 11, 2024

Would love to hear if these are being worked on.

from polacode.

sebelga avatar sebelga commented on May 11, 2024

Yes, this is quite strange indeed. Such a nice polaroid but a cropped shadow :( Not of much use...

from polacode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.