Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have light/dark variant of the backdrop in contrast to snippet background #8

Closed
jgierer12 opened this issue Feb 16, 2018 · 9 comments
Closed
Labels
feature New feature or request

Comments

@jgierer12
Copy link

Often, the gray background may not be ideal, such as when embedding into a blog with a white background. Allowing the user to set a custom background would solve this problem and make the output even more individualizable!

@WilliamDASILVA
Copy link

Indeed, I have seen similar screenshots of code with the same shadow on multiple blog posts that is embedded perfectly with the rest of the page.

Should be great to be able to change those parameter:

  • The background color
  • The shadow blur, distance, color
  • The padding
  • The border radius

@cfjedimaster
Copy link

While changing would be nice, I'd also be happy with just plain transparent. :)

@octref octref added the feature New feature or request label Feb 16, 2018
@octref octref changed the title Allow changing background color Have light/dark variant of background Feb 16, 2018
@octref
Copy link
Owner

octref commented Feb 16, 2018

Yeah, currently it does not handle light theme well.
However I like prettier's approach: have sane defaults and offer setting only when it's absolutely necessary to.
I think it's better to have Polacode reading the snippet background color, and figure out a contrasting background color automatically.

@jgierer12
Copy link
Author

jgierer12 commented Feb 16, 2018

I think there's a misunderstanding, my issue is not about light or dark themes but the grey background in the margins of the image. For example, the following image would blend in much more seamlessly if the background was white or transparent rather than grey:

@cfjedimaster
Copy link

Exactly as he said. Frankly I'm not even concerned about the colors inside the black portion, it's the gray border. Seeing it here on GitHub is a perfect example. If it was transparent, it could work anywhere. Thank you @jgierer12.

@octref octref changed the title Have light/dark variant of background Have light/dark variant of the backdrop in contrast to snippet background Feb 16, 2018
@octref
Copy link
Owner

octref commented Feb 16, 2018

I get what you are asking for. I was calling them snippet background (read from your theme) and background (set to #eee now). I'll just call the outer one backdrop.

@WilliamDASILVA
Copy link

Was about to say the same thing.
Tried to make a PR but didn't achieve to pass the settings parameters from extension.js to index.js; neither to access to the document object from extension.js.

const settings = vscode.workspace.getConfiguration('polacode');

In package.json:

"contributes": {
    "configuration": {
      "title": "Polacode configuration",
      "type": "object",
      "properties": {
        "polacode.backgroundColor": {
          "type": "string",
          "default": "transparent",
          "description": "A CSS value for the background color"
        },
        "polacode.outerPadding": {
          "type": "number",
          "default": 22,
          "description": "Outer padding in pixels"
        },
        "polacode.borderRadius": {
          "type": "number",
          "default": 5,
          "description": "Editor border radius in pixels"
        }
      }
    },
    "commands": [
      {
        "command": "polacode.activate",
        "title": "Polacode 📸"
      }
    ]
  },

Here is the result with the background-color: transparent; and a bigger padding to make it work well with the shadow (not being cropped)

testingpath

@timpulver
Copy link

Using a transparent background is much better than an opaque one, because it looks good everywhere.

@octref octref closed this as completed in 6923582 Feb 18, 2018
@octref
Copy link
Owner

octref commented Feb 18, 2018

I decided to have no backdrop for snippet with white background.

GitHub decides to give them white backdrop

1

2

Whereas Twitter gives them black:

image

Let's see how it goes.

Don't suggest adding options to me. I hate options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants