Skip to content

Instantly share code, notes, and snippets.

@josephfusco
Created December 3, 2020 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephfusco/24f810f5656ddfcb38fe6d06599180a2 to your computer and use it in GitHub Desktop.
Save josephfusco/24f810f5656ddfcb38fe6d06599180a2 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// My existing WordPress Project that requires MDL
// Assign namespace above MDL base-ui scss import.
// If no $namespace is assigned before importing MDL base-ui,
// no namespace is added.
$namespace: '#project-defined .specificity';
// Import single MDL scss file from within node_modules (Mimmick MDL import)
// @import "~@masonite/base-ui/styles/style.scss";
// Mock MDL SCSS below
$namespace: '' !default;
/// Namespace selectors if needed.
/// Used for projects to define their own specificity.
///
/// @param string $namespace Selector string that will prepend all selectors.
///
@mixin namespace($selector: ''){
@if ($namespace == '') {
@content;
}
@else {
#{$namespace} {
@content;
}
}
}
// Wrap the top level imports inside of mixin or individual SCSS partials.
@include namespace($namespace){
.product-card {
width: 100%;
max-width: 320px;
max-height: 480px;
margin: 0 auto;
text-align: center;
}
.card-link {
display: block;
box-sizing: border-box;
padding: 1rem;
text-decoration: none;
cursor: pointer;
}
}
#project-defined .specificity .product-card {
width: 100%;
max-width: 320px;
max-height: 480px;
margin: 0 auto;
text-align: center;
}
#project-defined .specificity .card-link {
display: block;
box-sizing: border-box;
padding: 1rem;
text-decoration: none;
cursor: pointer;
}
{
"sass": {
"compiler": "dart-sass/1.26.11",
"extensions": {},
"syntax": "SCSS",
"outputStyle": "expanded"
},
"autoprefixer": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment