我试图在我的项目中开始使用Bourbon和Neat Sass库.我想用Gulp编译Sass.这是一个简单的styles
任务设置,我在其中一个教程中找到了:
var gulp = require('gulp'),
sass = require('gulp-sass'),
neat = require('node-neat').includePaths;
var paths = {
scss: './assets/styles/*.scss'
};
gulp.task('styles', function () {
return gulp.src(paths.scss)
.pipe(sass({
includePaths: ['styles'].concat(neat)
}))
.pipe(gulp.dest('./dist/styles'));
});
gulp.task('default', function () {
gulp.start('styles');
});
Run Code Online (Sandbox Code Playgroud)
然后在主.scss
文件中我放置导入:
@import "bourbon";
@import "base/base";
@import "neat";
Run Code Online (Sandbox Code Playgroud)
此任务正确执行.
让我困惑的是究竟是什么includePaths
?基于上面的例子,有人可以向我解释一下includePath
角色是什么吗?
我正在使用波本威士忌和整洁的宝石来创建一个rails应用程序的设计.我的application.css.scss包含这个:
@import "bourbon";
@import "neat";
@import "main";
Run Code Online (Sandbox Code Playgroud)
但是,如果我运行'rake assets:precompile',则会发生以下错误:
rake aborted!
Undefined mixin 'outer-container'.
(in /Users/anonymous/example/app/assets/stylesheets/admin/main.css.scss)
/Users/anonymous/example/app/assets/stylesheets/admin/main.css.scss:5:in `outer-container'
/Users/anonymous/example/app/assets/stylesheets/admin/main.css.scss:5
Run Code Online (Sandbox Code Playgroud)
main.css.scss文件包含:
footer#page_footer {
@include outer-container;
nav{
@include span-columns(6);
@include shift(3);
section#about_me_footer, section#contact_footer, section#miscellaneous_footer {
@include span-columns(2 of 6);
}
}
p {
@include span-columns(6);
@include shift(3);
}
}
Run Code Online (Sandbox Code Playgroud)
有人可以给我一些建议吗?
我一直在使用波旁威士忌做一个桌面的第一个布局工作正常.
但是,我想做一个移动的第一个版本,从移动开始,然后继续努力.默认网格是12列,对于移动设备,我通常使用4的网格.我尝试将网格设置为4并扩展到12,但这不起作用.
除了创建标准桌面布局,然后将移动媒体查询放入每个CSS选择器并从移动版本开始并构建方式,是否有更好的方法来首先进行移动?
我是Bourbon/Neat的新手.我有一个关于嵌套的问题:我希望红色框填满整个宽度,它们之间没有沟槽.当对它们使用"@include omega"时,第一个框将删除其边距右边,但右边框仍然有边距,并且不调整其宽度.
你能告诉我如何让它们跨越整个父盒而它们之间没有任何边缘吗?
这是一个演示:http://wuergeengel.net.dd13736.kasserver.com/
这是我的标记:
<div class="container">
<div class="box box-left"></div>
<div class="box box-right">
<div class="box-red-left nested"></div>
<div class="box-red-right nested"></div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
这是我的风格:
.container
{
@include outer-container;
}
.box
{
border: 1px solid black;
height: 500px;
}
.box-left
{
@extend .box;
@include span-columns(4);
}
.box-right
{
@extend .box;
@include span-columns(8);
.nested
{
border: 1px solid red;
height: 400px;
&.box-red-left
{
@extend .nested;
@include span-columns(3 of 8);
@include omega;
}
&.box-red-right
{
@extend .nested;
@include span-columns(5 of 8);
@include …
Run Code Online (Sandbox Code Playgroud) 我知道以下可以在波旁威士忌中完成:
$mobile: new-breakpoint(max-width: 320px);
$tablet: new-breakpoint(max-width:760px min-width:321px);
$desktop: new-breakpoint(min-width: 761px);
Run Code Online (Sandbox Code Playgroud)
然后我可以这样做:
@include media($mobile) {
// some styling
}
Run Code Online (Sandbox Code Playgroud)
它很棒.现在我必须添加影响移动设备和平板电脑的样式.我正在寻找移动和平板电脑断点联盟.
//desired behavior
//I know this is not available. Just made up
@include media($mobile, $tablet) {
// some styling.
// this should be applied to mobile and tablet
}
Run Code Online (Sandbox Code Playgroud) 我正在使用Bourbon Refill导航菜单,并希望对其进行修改,以便在小模式下单击链接时,菜单会向上滑动.当菜单下降时,但是当单击菜单项时,菜单会保持下降状态.由于我使用带有固定顶级菜单的滚动页面,这意味着很多内容隐藏在菜单后面.
这是Codepen上的代码:
http://codepen.io/mikehdesign/pen/LVjbPv/
我现有的代码如下:
HTML
<header class="navigation" role="banner">
<div class="navigation-wrapper">
<a href="javascript:void(0)" class="logo">
<img src="https://raw.githubusercontent.com/thoughtbot/refills/master/source/images/placeholder_logo_1_dark.png" alt="Logo Image">
</a>
<a href="javascript:void(0)" class="navigation-menu-button" id="js-mobile-menu">Menu</a>
<nav role="navigation">
<ul id="js-navigation-menu" class="navigation-menu show">
<li class="nav-link"><a href="javascript:void(0)">About Us</a></li>
<li class="nav-link"><a href="javascript:void(0)">Contact</a></li>
<li class="nav-link"><a href="javascript:void(0)">Testimonials</a></li>
<li class="nav-link"><a href="javascript:void(0)">Sign up</a></li>
</ul>
</nav>
Run Code Online (Sandbox Code Playgroud)
SCSS
.navigation {
$large-screen: em(860) !default;
$large-screen: $large-screen;
// Mobile view
.navigation-menu-button {
display: block;
float: right;
margin: 0;
padding-top: 0.5em;
@include media ($large-screen) {
display: none;
}
}
// Nav menu
.navigation-wrapper {
@include …
Run Code Online (Sandbox Code Playgroud) 我正在重写一个使用Bourbon的"旧"React原型,它还在gulpfile中使用gulp-sass来注入一个节点整齐的依赖:
var sassOptions = {
includePaths: require('node-neat').includePaths,
};
Run Code Online (Sandbox Code Playgroud)
我想使用create-react-app
样板并通过使用npm脚本编译sass文件来为样式设置一个"简单"的工作流程(也因为create-react-app限制了你)但我无法弄清楚如何去做.
"build-css": "node-sass src/styles/ -o src/",
"watch-css": "npm run build-css && node-sass src/styles/ -o src/ --watch --recursive"
Run Code Online (Sandbox Code Playgroud)
我可能会在将来使用不同的方法重写样式(可能使用样式组件,可能继续使用Sass并完全忽略Bourbon)但我只需要从旧项目中移植Sass样式.
有关集成create-react-app(不弹出)和Bourbon/Neat的任何想法?
有没有办法将neat.includePaths位放入package.json中的node-sass单线程脚本中,例如?
我正在制作一个用于时间序列数据分析的机器学习程序,使用 NEAT 可以帮助完成这项工作。不久前开始学习TensorFlow,但似乎TensorFlow中的计算图通常是固定的。TensorFlow 中是否有工具可以帮助构建动态演化的神经网络?或者像 Pytorch 这样的东西会是更好的选择?谢谢。
似乎我的程序正在尝试学习直到某个点,然后它就感到满意并且根本停止改进和改变。通过我的测试,它通常最多达到 -5 的值,然后无论我让它运行多久,它都会保持在那里。结果集也不会改变。
只是为了跟踪它,我做了我自己的日志记录,看看哪个做得最好。1 和 0 的数组指的是 AI 做出正确选择的频率 (1),以及 AI 做出错误选择的频率 (0)。
我的目标是让 AI 重复高于 0.5 然后低于 0.5 的模式,不一定要找到奇数。这只是一个小小的测试,看看我是否可以让 AI 使用一些基本数据正常工作,然后再做一些更高级的事情。
但不幸的是它不起作用,我不确定为什么。
编码:
import os
import neat
def main(genomes, config):
networks = []
ge = []
choices = []
for _, genome in genomes:
network = neat.nn.FeedForwardNetwork.create(genome, config)
networks.append(network)
genome.fitness = 0
ge.append(genome)
choices.append([])
for x in range(25):
for i, genome in enumerate(ge):
output = networks[i].activate([x])
# print(str(x) + " - " + str(i) + " chose " + …
Run Code Online (Sandbox Code Playgroud) neat ×10
bourbon ×7
sass ×5
css ×3
python ×2
assets ×1
c# ×1
grid ×1
gulp ×1
javascript ×1
jquery ×1
node-sass ×1
npm-scripts ×1
pytorch ×1
tensorflow ×1