Incorporating style to select buttons within a Vue.js application: A step-by-step guide

Take a look at the code below:

<template>
  <DxPopup
    v-bind="$attrs"
    v-on="$listeners"
    :hide-on-outside-click="true"
    :drag-enabled="true"
    :wrapper-attr="popupAttributes"
    position="center"
    @hiding="onHiding"
  >
    <slot />
    <slot name="footer">
      <DxToolbarItem class="btn-default" widget="dxButton" toolbar="bottom" :options="okButtonOptions" />
      <DxToolbarItem class="btn-default" widget="dxButton" toolbar="bottom" :options="closeButtonOptions" />
    </slot>
  </DxPopup>
</template>
<script>
import { DxPopup } from 'devextreme-vue/popup';
import { DxToolbarItem } from 'devextreme-vue/popup';

export default {
    inheritAttrs: false,
    components: {
        DxPopup,
        DxToolbarItem
    },
    data() {
        return {
            popupAttributes: {
                id: 'popup-base',
            },
<style lang="scss">
#popup-base .dx-popup-normal {
  border-radius: 20px;
}
#popup-base .dx-texteditor-input {
  color: #8ca8cc;
  font-family: $primary-font-family;
  font-size: 15px;
}
#popup-base .dx-popup-title {
  border-bottom: 0px;
  font-weight: bold;
  font-size: $font-xl;
  color: $accent-color;
}
#popup-base .dx-label {
  color: $accent-color;
}
#popup-base .dx-button-content {
  border: 1px solid $accent-color;
  color: $accent-color;
}
</style>

Here's a preview of the modal dialog:

https://i.sstatic.net/lMTkc.png

Is there a way to only apply the #popup-base .dx-button-content rule to the two buttons at the bottom?

Answer №1

The proposed solution:

export default {
    inheritAttrs: false,
    components: {
        DxPopup,
        DxToolbarItem
    },
    data() {
        return {
            popupAttributes: {
                id: 'popup-base',
            },
            okButtonOptions: {
                text: 'Save',
                elementAttr: {
                    class: 'btn-default'
                },
<style lang="scss">
.btn-default {
    border: 1px solid $accent-color;
    color: $accent-color;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is it possible to achieve Bootstrap 3-style for the mobile navbar menu in Bootstrap 4?

In the world of Bootstrap 4 https://i.sstatic.net/bMSOK.png Comparing to Bootstrap 3 https://i.sstatic.net/RVITm.png Seeking to replicate Bootstrap 3's menu in Bootstrap 4? This code snippet showcasing Bootstrap 4's menu can be found at : & ...

Change the WordPress Divi Builder nav bar to switch from transparent to white when scrolling or upon reaching a specific point on the page

Currently, I am in the process of revamping our company's WordPress website using the Divi Builder. For the past couple of days, I have been scouring the internet trying to find a solution that would allow the navigation bar to change CSS classes as t ...

Tips for adjusting alignment in MaterializeWould you like to change the alignment

I have implemented the Materialize framework for my front-end design. Initially, everything looks good when the page loads, but upon returning to the index, there is an alignment issue. Clearing the cookies seems to fix it. Here is how it currently looks: ...

Vue not displaying information from API calls

After developing my own backend API, I encountered a strange issue. When I test the API on Chrome, it functions perfectly fine. However, when I attempt to consume the API using Axios in Vue, no data is returned. axios.get('http://192.168.149.12:8888/ ...

Create a stylish div slider with interactive menu using Jquery

Currently, I am in need of creating a slider for a <div>. However, most plugins are too large for my needs, so I am attempting to develop my own jQuery script since I only require the basic functionality. Admittedly, I am a novice in jQuery and could ...

What is the best way to increase the size of a specific text style?

Recently, I created a post in WordPress that included some code samples. To ensure the code was displayed neatly, I utilized the "preformatted" style. However, upon previewing it, I noticed that the text within the code samples was incredibly small, almost ...

How can I make Firefox render the padding in a textarea the identical way as in a div?

In my efforts to ensure a consistent line width inside a textarea across IE8, Firefox, and Safari, I have encountered an issue where Firefox seems to add an extra pixel of padding compared to the other browsers. This results in text wrapping differently an ...

Is it possible to adjust the CSS code linked to the HTML tag based on the specific webpage being viewed?

I am facing an issue with the homepage of my website, which uses Scrollmagic.js for smooth scrolling. In order for the sticky footer CSS to work properly on all other pages, the HTML tag needs to have a height of 100%. However, if I add this height value t ...

Incorporating an external Angular.js library into a Vue.js Single File Component

I am working with a Single File Component in Vue.js that includes the following code. The plasmid tag should be rendered by the angularplasmid.complete.min.js file, but it doesn't seem to be working. I'm wondering if this is the correct way to i ...

Securing API from unauthorized direct access

Currently, my backend and frontend are separate but hosted on the same server (although this setup may change in the future). The backend functions as an api and is built using Laravel, while the frontend uses Nuxt (Vue). I want to restrict access to the ...

Overflow issues with CSS FlexBoxLayout

I am currently working on creating a website using Bootstrap and CSS's flexbox. My goal is to create a list that fits the height of the screen without overflowing it. After some trial and error, I managed to come up with a solution that looks like th ...

The child div vanishes abruptly instead of smoothly transitioning like its parent

I have created a demo that showcases a simulation of the issue here. Codepen: https://codepen.io/anon/pen/pXvyMd I am attempting to achieve a fading effect on the caption text 'this is a test' when hovering over the box at the top right of the ...

Leveraging JSON data to dynamically create HTML elements with multiple class names and unique IDs, all achieved without relying on

Recently, I've been working on creating a virtual Rubik's cube using only JS and CSS on CodePen. Despite my limited experience of coding for less than 3 months, with just under a month focusing on JS, I have managed to develop two versions so far ...

Converting canvas illustrations into HTML files

I am in the process of creating a drawing application that will be able to export into HTML/CSS/JavaScript. I plan to use this tutorial as a foundation for the drawing functionality. My goal is to take all the rectangles within the this.shapes = [] array a ...

What is the CSS selector for the top-level heading?

Is there a way to target the first occurrence of the highest heading element (h*) in a DOM structure? Perhaps something along the lines of (h1, h2, h3, h4, h5, h6):first-of-ordered-set For example, if the DOM contains h2, h3, h1, h2, h1, it should selec ...

JavaScript MP3 player

Could someone kindly point out where I went wrong? I am attempting to create an MP3 player using CSS, HTML, and JavaScript. Currently, the script only functions to start or stop the audio file. However, I keep encountering an error message: TypeError: docu ...

Show buttons in varying styles aligned next to each other

Here is the code snippet I'm currently working with: <fieldset class=last> <button>Refresh</button> <button> Clear</button> </fieldset> <form method="POST" action="*******"> <button> Down ...

Setting the maxDate property for the datepicker in element.io using Vue.jsBelow are instructions on how to set

I am currently utilizing the ''. I have integrated 2 date pickers from this component. Let's refer to them as Picker A and Picker B. My goal is to set the max-Date property for Picker A. If I select a date from Picker B first, then that ch ...

Issues arising from the interaction of one DIV with another DIV

I'm having trouble positioning a menu (height = 100%) next to the logo. Essentially, when the image controls the height of the DIV (container), it seems logical that adding another DIV (menu) with height: 100% inside that DIV (container) should resul ...

Guide to sending a reference to a child input element using VueJs

I am currently attempting to pass a ref in order to retrieve the value of the input (base-input component) upon submission. The two components are listed below. Despite having a console.log statement in handleSubmit, the email variable always appears as un ...