如果我创建了一个文件,或者更改了它,那么 grunt 就可以正常工作。watch 任务找到文件,注意到变化,并创建 css 文件。
除了一个文件。
这个:
这是scss:
// Import variables, abstractions, base styles and components.
// Uncomment the next lines and adjust them to your needs.
//@import "variables/{YOUR FILE NAME HERE}";
//@import "abstractions/{YOUR FILE NAME HERE}";
//@import "base/{YOUR FILE NAME HERE}";
//@import "components/{YOUR FILE NAME HERE}";
/*
@import "variables/_colors.scss";
@import "variables/_fonts.scss";
@import "variables/_grid.scss";
@import "variables/_mixins.scss";
*/
@import "variables/_colors";
@import "variables/_fonts";
@import "variables/_mixins";
* {
margin: 0;
padding: 0;
}
img, media {
max-width: 150%;
}
h1 {
padding: 1em 0;
color: $brown;
}
h2 {
padding: 1em 0 1em 0;
color: $brown2;
}
h3 {
padding-bottom: 1em;
color: $brown2;
}
body {
margin: auto;
background-image: url("../images/background-paper.jpg");
}
a:link {color: $brown;}
a:visited {color: $brown;}
a:hover {color: $green;}
a:active {color: $green;}
a {
text-decoration: none;
}
/*HEADER*/
/*FIRST MENU*/
.pane-superfish-1,
.pane-superfish-2 {
float: right;
clear: right;
margin-top: 1em;
}
.sf-main-menu {
margin-top: 1em;
}
.sf-menu {
.active {
color: $green;
}
.leaf {
list-style-image: none;
list-style-type: none;
}
}
.sf-menu {
margin-top: 2em;
li {
li:active {color: $green;}
a {
margin: .5em;
list-style-type: none;
border-right: 2px solid $brown;
padding-right: .5em;
}
}
li:last-child a {
border-right: none;
padding-right: 0;
li:active {color: $green;}
}
}
/*SECOND MENU*/
.menu {
margin-bottom: 1em;
}
.sf-menu-content-menu {
margin-top: 2em;
font-weight: bold;
color: $secondmenu;
li .sf-depth-1 {
a {
padding: .5em;
list-style-type: none;
}
}
}
.sf-menu .sf-with-ul + ul {
/*background: url("../images/background-paper.jpg");*/
background: $brown2;
border-radius: 5px;
border: 1px solid $brown;
position: absolute;
left: 50%;
@include box-shadow(0px 0px 1px 1px rgba(119,70,40,1));
li a{
color: $butter;
}
}
.sf-menu .sf-with-ul + ul:after {
bottom: 100%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-color: rgba(167, 112, 3, 0);
border-bottom-color: #A77003;
border-width: 10px;
margin-left: -10px;
}
.sf-menu .sf-with-ul + ul li a:hover {
background: $fade;
}
.sf-menu li:hover > ul, .sf-menu li.sfHover > ul {
left: -55px;
}
/*menu-arrow*/
.sf-menu .sf-sub-indicator {
background: url("../images/arrow-brown.png") no-repeat;
height: 15px;
top: 25px;
display: block;
width: 100%;
left: 45%;
}
/* END MENUS*/
.panels-flexible-1 .panels-flexible-row {
padding: 0;
margin: 0 0 1em 0;
placeholder: valami;
}
.header {
max-width: 960px;
line-height: 1em;
.sitetitle {
overflow: hidden;
opacity: 0.9;
font-size: $focim;
font-weight: lighter;
letter-spacing: 0.05em;
vertical-align: baseline;
vertical-align: middle;
line-height: 4em;
a {
color: $title;
margin-left: 1em;
}
span {
padding-left: 1em;
}
}
}
.panels-flexible-2 .panels-flexible-row { /*header*/
margin: auto;
margin-top: 2em;
padding: 0;
}
/* HEADER END*/
.panels-flexible-2 .panels-flexible-row {
padding: 0;
}
.panels-flexible-region-2-header {
width: 100%;
}
.panels-flexible-row.panels-flexible-row-2-main-row.clearfix{
max-width: 960px;
}
#logo {
img {
max-height: 100px;
float: left;
vertical-align: middle;
}
}
/*SILDESHOW*/
.views_slideshow_cycle_main {
background-image: url("../images/slideshow-background.jpg");
border-top: 10px solid $green;
}
/*keskeny rész*/
.views-slideshow-cycle-main-frame {
margin: auto;
max-width: 960px;
}
/*faltól falig érő rész*/
.views-slideshow-cycle-main-frame-row-item {
.views-field.views-field-title {
margin: auto;
padding: 1em;
font-weight: bold;
font-size: $focim;
font-weight: lighter;
a {
color: $light-yellow;
}
}
.views-field-body {
max-width: 960px;
margin: auto;
padding: 1em;
color: $butter;
overflow: hidden;
}
}
.views-field-field-highlight-image .field-content img {
float: right;
margin-left: 4em;
border: 7px solid $butter;
margin: 1em;
}
/*SILDESHOW END*/
/*CONTENT*/
.pane-title {
padding-bottom: 1em;
color: $brown;
}
.node__title {
font-size: $alcim;
}
.views-row {
margin-bottom: 2em;
}
.panel-display.panel-2col.clearfix {
.views-field-title {
font-weight: bold;
padding-bottom: 1em;
display: block;
}
}
.pane-node-field-bor-t-k-p {
img {
border: 2px solid black;
}
.pane-entity-field.pane-node-body {
padding: 1em;
background-color: $fade;
}
}
.pane-node-field-b-vebben a {
padding: .5em;
margin: .5em;
float: right;
font-weight: bold;
background: $fade;
border: 3px solid $brown;
border-radius: 15px;
@include box-shadow(0px 0px 1px 1px rgba(119,70,40,1));
}
.pane-node-field-b-vebben a:hover {
@include box-shadow(0px 0px 1px 1px rgba(8,98,27,1));
border: 3px solid $green;
}
.pane-konyv-konyvek-pane .view-content .views-row {
@include box-shadow(0px 0px 2px 2px rgba(119,70,40,1));
padding: 1em;
border-radius: 3px;
}
.pane-konyv-konyvek-pane .view-content .views-row:hover {
@include box-shadow(0px 0px 1px 1px $light-yellow);
background: $fade;
}
/*CONTENT END*/
.footer {
background-image: url("../images/slideshow-background.jpg");
text-align: center;
margin-top: 1em;
a {
padding: 1em;
display: block;
}
}
grunt watch 命令注意到这些变化,并写入 DONE。(没有错误)但是css没有改变。
如果我将此代码复制到另一个文件中。grunt 将它编译成这个 css:我不知道这是什么。这还不够。看?
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address,
big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center,
dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article,
aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline; }
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
display: block; }
body {
line-height: 1; }
ol, ul {
list-style: none; }
blockquote, q {
quotes: none; }
blockquote::before, blockquote::after {
content: '';
content: none; }
q::before, q::after {
content: '';
content: none; }
table {
border-collapse: collapse;
border-spacing: 0; }
/*# sourceMappingURL=tarsoly.css.map */
而已!我的每个 scss 都在工作,除了这个。
这是我的 gruntfile:
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
uses_defaults: {}
},
sass: {
dist: {
options: {
style: 'expanded',
sourceMap: true
},
files: [{
expand: true,
cwd: 'sites/all/themes/tarsoly/sass/',
src: ['**/*.scss'],
dest: 'sites/all/themes/tarsoly/css/',
ext: '.css'
}]
}
},
watch: {
css: {
files: 'sites/all/themes/tarsoly/**/*.scss',
tasks: [ 'sass' ],
options: { livereload: true }
}
},
});
// Default task(s).
grunt.registerTask('default', ['watch']);
// Load Grunt plugins
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-sass-globbing');
};
你能帮助我吗?