Comments (9)
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.
@jeremy-ingenuity I used it here and if you see, without that cropping would have looked so much better.
from polacode.
Transparent background would be absolutely amazing.
from polacode.
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.
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.
Yes same here @MatteoGabriele , I was using it for a Medium post :D
Thank you very much to the developer!
from polacode.
Yes, I also need this feature, I want to use this plugin in my PowerPoint!
from polacode.
Would love to hear if these are being worked on.
from polacode.
Yes, this is quite strange indeed. Such a nice polaroid but a cropped shadow :( Not of much use...
from polacode.
Related Issues (20)
- Bug HOT 1
- Is this project actively being maintained? HOT 3
- When there are too much code, some part of the output image is broken
- Misaligned code photo HOT 3
- Polacode Extension
- Bug!! HOT 2
- Indentation not working for Python files
- Allow us to specify a theme
- Changing Background Color Resets after Copy+Paste
- When there are many lines of code, the button doesn't react. HOT 7
- Support Copy image to Clipboard HOT 3
- Allow code adjustments in the snippet window
- Polacoda does not save anything when connected to a remote machine via ssh
- Display built-in rainbow bracket colors
- Polacode not respecting font styles set in ligatures
- Polacode not working
- Polacode not working with Windows + WSL2
- The text breaks when saving
- Polacode not working on MacOs 14 + VS Code 1.82.2
- Polacode extension not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from polacode.