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

My style does not work #12

Closed
tatane616 opened this issue Apr 20, 2019 · 3 comments
Closed

My style does not work #12

tatane616 opened this issue Apr 20, 2019 · 3 comments

Comments

@tatane616
Copy link

I use previewTemplate, and want to use some styles.
Inline CSS is work normally, but CSS in <style> block does not work.

<script>
...

data() {
    return {
        ...
      options: {
        previewTemplate: this.template(),
      }
    };
  },
  methods: {
    template() {
      return `
          <div class="preview__card">
            ...
          </div>
        `;
    },
  },
...
</script>

...

<style lang="scss" scoped>
.preview__card {
  background-color: red;
}
@tatane616
Copy link
Author

This problem was due to scoped style.
It worked well without scope

@ajingopi-bridge
Copy link

@tatane616 This saved my day.

@RokasDie
Copy link

You can also use /deep/ before css class in scoped, like this:

<style lang="scss" scoped>
/deep/.dz-message {
  font-size: 20px;
}
</style>

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

No branches or pull requests

3 participants