Open geoffdavis92 opened 8 years ago
Thank you. I haven't any plan on JS library for .menu
, .modal
or .toast
.
.col-xs-
, col-sm-
, col-md-
.Thank you. š
@picturepan2 I cleaned up and updated the javascript that I previously wrote. Still could use some work, but this will give you some idea of what I was shooting for. Here is the link.
I have 3 files so far, one for menus, modals, and toasts each; technically there could be 4, as I added support for an arrow pseudo element that could switch orientation on click, but I don't know if you wanted that in the project.
menu.spectre.js
handles toggling menus, and works best when .hide
is applied in the menu's html. Currently, only clicking the toggling element will open/close the menu.modal.spectre.js
handles opening modals using a button/link, and closing the modal via either .btn-clear
button, a link that has data-target=#idOfModal
/data-close="modal"
, or clicking the modal overlay.toast.spectre.js
handles closing toasts; this obviously only works on the frontend, and perhaps I will write in a function or method that will allow a callback on closing toasts, so developers can write an API-handling event when a modal closes.Like I said, these are kind of rough, and only use ES6/vanilla JS. If you like the idea, I can optimize these and write more .js
files.
Edit: worth noting that at the moment these are a combined 24kb, uncompressed.
Thank you. I think I will wait and see if other people need JS example codes, maybe just jQuery or Angular examples. Firstly, I need to perfect basic CSS codes.
First, thanks for this amazing project. So simple, clean and powerful! Second, would be great to have a Sass variant (scss).
@victorwpbastos May I know why you want Sass variant?
@picturepan2 The reason I suggested it originally is because not every one uses LESS, which is fine, and some people would like to compile it during development with custom variable settings.
Sass is just a personal preference. Many CSS frameworks are using Sass instead Less. But I repeat: is just a personal preference.
Thank you both. Do you know tools to keep Less and Sass coexist and synced?
Maybe maintain the two flavors (Less and Sass) won't be a good idea. If you like Less keep Less. No problem.
OK. I will keep Less. I will read more about Sass to see if Spectre.css needs a switch.
@picturepan2 sass would be an important port! any reason for less implementation?
SASS version would be great.
SASS version +1
Generally I use Foundation or Bootstrap, and there is a Foundation feature that nobody offers, it's list-block-grid support. In few words if you have an inline list (for example a list of cards) you can specify how many elements display for each row without breaking the list at dom level.
No. I dont think SASS version make situation more better. It make things worse! Support two versions is harder. And its make more time to review pull requests and and test everything
I have seen a lot of projects move from less to sass, but never from sass to less.
Moved from Less to Sass. Bootstrap now compiles faster than ever thanks to Libsass, and we join an increasingly large community of Sass developers.
To me it's a bit like underscore vs lodash.
@IgnisFire I don't think anyone is suggesting @picturepan2 should support 2 different versions, at least not concurrently. If he were to offer a Sass port and did not want to maintain both, he could release stable Sass versions at major framework versions.
I see the benefit from moving away from LESS to Sass, as @jakobrosenberg pointed out, Sass is faster, and offers (AFAIK) more options for compiling in a variety of languages, including node.js, ruby, python, and more.
On top of this is that a majority of development blogs/articles/developers I'm aware of use Sass to compile their styles into CSS. All these benefits point to Sass being a better pre-compiled language to use for customizing Spectre.css.
@All, I plan to switch to Sass and release a stable version of Less. Thank you.
I like the idea of @geoffdavis92 to add JavaScript and I even more like the idea of not using dependencies. However, I looked at the code I'd really recommend not to touch prototypes as it is considered to be (very) bad practice.
Adding some kind of simple bundler (e.g. Rollup) could be useful to provide some kind of internal structuring without the hassle of using a sophisticated build chain.
Sass!! Sounds good!!
@dak0rn Yeah I only added that because I somehow forgot about Array.forEach
, and was too lazy to look it up.
Sometime soon I'm going to generally clean up the scripts and I'll remove my prototype edit.
@geoffdavis92 just wanted to mention it.
I hope a possible JavaScript part is not going to target non-ES5.1 environments like the Internet Explorer 8, because that would introduce quite a nasty limitation.
I think it's best to leave Javascript out of the picture and for Spectre to remain a focused CSS / Design library while encouraging JS component libraries to be built on top of the framework. Salesforce's design system is a good example of how to go about this. https://www.lightningdesignsystem.com/
Spectre is really simple and I support the idea of keeping Sectre CSS only as well because it is easy to add any existing JS plugin on top of the layout. And supporting SASS would be "just what doctor ordered".
@imanhodjaev That's what I'm feeling is the consensus.
I'll likely release my library as a "plugin", after cleaning it up and building it out a bit. Not sure how I could brand it, but that's a topic for another time š
I confess that I just did not begin to use the Spectre because it is not in Sass. It would be great to work with Spectre in Sass.
Converting the less-code to sass cost me 5 minutes. You only need to replace the @-sign for variables with the $-sign and add mixins+include instead of the classes which are used for global usage of styleheets. It can't be easier...
what about the js modules idea? I think it would be a nice benefit if you can add optional "official" spectre js modules to the page to extend the css functionality of individual elements/components.
Please don't make JS an integral part of this framework: I choose it over bootstrap/foundation specifically because it was pure CSS only.
I thinks it is ok to make optional scripts for simple interactions (like a jquery plugin or some vanilla code) and like a reference for implementation but, since Js is so opinionated, writing any kind of code will probably lead to a dozen of variants (react, angular, angular2, kendo,....) with many build systems integrations and feature requests. I think that this is out of scope for a lightweight library like this and, if forced to reference a Js to use the components, I will just stop updating it and fork it locally.
Just my two cents.
@IlBaffo I agree.
I'm currently writing a standalone Javascript library using vanilla js to interact with various spectre.css components.
I finished writing a preliminary version of handling .tab.tab-group
last night, will push up in a few hours.
I like spectre for the same reasons you do, but if I can write a simple js library to interact with spectre, I think that'd be helpful to a lot of folks. Not everyone has the time/patience/skill to roll their own.
Again, this will be completely optional and unofficial.
(I've extended an offer to @picturepan2 to house everything under an org like #50 suggests, but it's entirely up to him. Even still this would just be a completely optional library)
EDIT: added some emphasis
@geoffdavis92 I have to +1 the notion of keeping JS out of the equation. Keeping it CSS only means that it can be integrated with any framework you want without much issue. At the minute, I'm demoing dropping it into Angular 2 and it works a treat (tabs handled via bindings)
EDIT: I wanted to add... I have been tinkering with the library and adding things I think are cool. I've been using Google Material Icons to get a nicer checkbox and radio button in my UI, without having to modify the HTML markup. Here's a simple example: https://jsfiddle.net/e8dhLhyn/75/
Let me know if anyone would like to see these in a PR to the codebase, or if any other contributions would be welcome.
For me one of the reasons to choose spectre was that it is CSS only. I use bootstrap in another project. The javascript part modifies the HTML elements so that customizing the boostrap elements is not fun. Please don't add JS support.
There's already several different javascript implementations that I know of. (vue, can, vanilla etc) Would it be helpful for anyone to have a page in the docs or somewhere called "JS implementations" with links to the projects?
I'd contribute to that
spectre css logo for attribution link? and where I can find a collaboration partner(who used to be a spectre css hobbyist for a open source project)?
@faststare what's the project?
@aaron-bond an accounting web app that have philippine government features(taxation handling and gocc handling).
I think it'll be a great idea to create a react.spectre
much like how a react.semantic-ui
exists.
@geoffdavis92 the library you're creating, does that provide any sort of react components, or is it to be used outside react.
@faststare You need a Spectre.css logo in which sizes?
Is there a logo? I'd put one on my project site also.
@zusamann React is future.. Or better.. Is Present.. Maybe a good moving idea in this regard.
@zusamann @AdsonCicilioti me, probably like @IlBaffo and many others have chosen this framework because of 2 main great features:
Those 2 facts make it unique, special and different from most of what you can find out there. It is not one more framework trying to do all the work or providing whatever feature you may need like if it was some kind of software a browser need to download on each visit. It is fast because it is simple. Please if you need a Javascript Library for it consider making a fork and adding that to a different repo.
Again, this will be completely optional and unofficial.
Oh sorry I didn't see that. In that case I 100% agree :)
Could I also suggest a sticker board, or something like sketchapp.com for designers.
@flyboarder What is a sticker board?
Usually a collection of the components for prototyping.
https://material.io/guidelines/resources/sticker-sheets-icons.html
@geoffdavis92 v0.4.0 is in SASS/SCSS now.
First off, love the framework! Really great, clean design, implements many common components flawlessly, yet is incredibly tiny. (filesize-wise)
Do you have any plans for writing a JS library for interactions with various components, eg
.menu
,.modal
, and.toast
? If you haven't or have but have not implemented it yet, I have a few files for said components that could provide a jumping-off point for writing these JS interactions; they're simple, curt, and use vanilla JS.Other suggestions:
@variable
instances to$variable
, but I may be mistaken).col-8
class, along with apparently all other.col-x
classes simply default to 50% between 481px and 840px. There may have been a reason for this, but I am not picking up on it.I am more than willing to help with any of the above, and will likely be throwing some PRs your way.