[Feature Request] Documentation: Describe how to use sass to aggregate multiple vuetify css classes
See original GitHub issueProblem to solve
Keeping things DRY with CSS.
Currently when multiple vuetify classes (e.g. .text-caption .text-left .font-weight-thin
) are used in numerous places in a page, these all have to be edited and maintained individually causing orders of magnitude more edits, and bugs.
A solution was searched for and asked on discord but answers were not forthcoming.
A naive implementation caused a sass
build time error:
ERROR in ./components/Section.vue?vue&type=style&index=0&id=1b21a30e&scoped=true&lang=sass&
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: The target selector was not found.
Use "@extend .text-caption !optional" to avoid this error.
╷
97 │ @extend .text-caption
│ ^^^^^^^^^^^^^^^^^^^^^
╵
Proposed solution
Describe how to use sass
to create aggregate class definitions. Correct the following code and place within the documentation.
<style scoped lang="sass">
@import '~vuetify/src/styles/styles.sass'
.section-text
@extend .text-caption
@extend .text-left
@extend .font-weight-thin
...
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:5 (3 by maintainers)
Top Results From Across the Web
SASS variables - Vuetify
Once installed, create a folder called sass , scss or styles in your src directory with a file named variables. scss or variables....
Read more >Vue - Mixing SASS with SCSS, with Vuetify as an Example
A guide on mixing Sass-syntax and SCSS-syntax within a single Vue project, and how it can conflict with vendor Sass files, such as...
Read more >SASS combine multiple classes from vuetify's flex utilities
In my sass code, I tried to combine the classes together using @extend @import '~vuetify/src/styles/styles.sass' @import ...
Read more >justify-self - CSS: Cascading Style Sheets - MDN Web Docs
The CSS justify-self property sets the way a box is justified inside its ... In the following example we have a simple 2...
Read more >Vuetify [Feature Request] Can not apply hover with rowspan ...
class ="elevation-1". 9. > 10. <template slot="headers" slot-scope="props">. 11. <tr>. 12. <th. 13. v-for="header in props.headers". 14. :key="header.text".
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You don’t. You would have to import
~vuetify/src/styles/main.sass
instead as that actually contains the classes you want to extend, but then you will get duplicated styles:https://stackoverflow.com/q/58905949/2074736
https://github.com/webpack-contrib/sass-loader/issues/145#issuecomment-173984354
or
Depending on how https://github.com/sass/sass/issues/2745 is implemented (if ever) this might eventually be possible.